× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



DATA_INTO, like XML-INTO, deals with this via the case=convert option. That replaces hyphens in names by underscores, which you can use in RPG.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On May 2, 2019, at 6:27 AM, Kris <kris.chantry@xxxxxxxxx> wrote:

How to define variables with a hyphen in the name



For a CRM project that we have setup within the company, I need to connect
to a webservice of HUBSPOT.

This webservices returns a JSON file with the needed contact data.

https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo&count=1



In the resultset there are fields with a hyphen in the name.

When I want to declare these in a datastructure so that I could use the
DATA-INTO function, I get errors about the naming of these fields.



Can anyone tell me how to declare these fields?

- Portal-id
- Identity-profiles
- Vid-offset
- …



OR.. can I telle the DATA-INTO function to replace the hyphen(-) in the
fieldnames with underscores (_) ?







My example DataStructure:

dcl-ds result qualified;

error_message varchar(2048);

dcl-ds contacts dim(100);

svid packed(18:0);

portal-id packed(18:0);

dcl-ds identity-profiles;

dcl-ds identities;

type char(128);

value char(1024);

end-ds;

end-ds;

end-ds;

vid-offset packed(18:0);

status char(255);

message char(512);

end-ds;







Resultset of the webservice call:

https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo&count=1



{

"contacts": [ {

"addedAt": 1556787992326,

"vid": 12035724,

"canonical-vid": 12035724,

"merged-vids": [],

"portal-id": 62515,

"is-contact": true,

"profile-token":
"AO_T-mMGNUk29SlBw2t27jl8bFqth4QIA3kiuXtFtN3xvEiFMse-_v9pPRoMXMrwqPbjU6Rjkyjo2aDWL_1aCDQ2e3LTtL-ivdBcOK0p59U2l74BfOQx12Dc2g-KeKtKqOT2xirqeNOX",

"profile-url": "
https://app.hubspot.com/contacts/62515/contact/12035724";,

"properties": {

"firstname": {"value": "EDITFIRST"},

"lastmodifieddate": {"value": "1556787992326"},

"company": {"value": "EDIT AG"},

"lastname": {"value": "1556787363EDITLAST"}

},

"form-submissions": [],

"identity-profiles": [ {

"vid": 12035724,

"saved-at-timestamp": 1556787986082,

"deleted-changed-timestamp": 0,

"identities": [

{

"type": "EMAIL",

"value": "1556787363@xxxxxxx",

"timestamp": 1556787986065,

"is-primary": true

},

{

"type": "LEAD_GUID",

"value": "b5ce58ed-5d3d-48ee-9887-1bc958417101",

"timestamp": 1556787986074

}

]

}],

"merge-audits": []

}],

"has-more": true,

"vid-offset": 12035724,

"time-offset": 1556787992326

}



Kind regards,

Kris
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.