Did anyone use DATA structures In CL

60 pts.
Data structures
As of V5R4 it is possible to use Data structures in CL similar to RPG. The most useful thing to use is for qualified commands where the qualifie parameter is a File and Libraray. but itl looks to me that it does not work when the parameter is a data structure and the program is CLLE. in CL it works.

Answer Wiki

Thanks. We'll let you know when a new response is added.

It isn’t a data structure exactly, its just a new tag against a memory location.

so a 20 byte field can be addressed at the start, for 10 bytes, or at position 11, for 10 bytes.

You would have to pass your ‘data structure’ as a field of length = DS length, then assign the contents to fields by position.

Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    Please show an example of it not working. The variable upon which subvariables are defined is just another variable. It can be passed the same as variables have always been passed. If you have a problem, please show the commands that don't work. If we don't see it, we can't say what's wrong with it. Tom
    125,585 pointsBadges:
  • WoodEngineer
    Don't know if this will help but I have noticed something unexpected using this new feature in V5R4. When I run the CL program in debug I see two different behaviors. If the "data structure" is applied to one of the run-time parms, debug shows the data from the beginning of the parm but for the correct length of the DS. For example, 12 character run-time parm of "P!BUPTA123435" is split into a 2 and 10 character DS. In debug the 2 char DS shows "P!" while the 10 character DS shows 'P!BUPTA123". However, when the 10 char DS is moved to a 10 character variable it contains "BUPTA12345", just as one would expect. The same 10 char DS variable works just fine in the code so no worries there. I checked this several time with the same result. The behavior is different for variables which are NOT run-time parms. They behave as you would expect when viewed in debug, i.e. the 10 character DS contains "BUPTA12345". Perhaps you are seeing this behavior on one-time parms which would lead one to believe the "DS" feature is not working.
    8,245 pointsBadges:
  • TomLiotta
    At least for V5R4, there is a bug related to the representation of variable values in debug, and, IIRC, in DMPCLPGM. IBM claims that actual values are correct and only their presentation is wrong. I thought I recalled that V5R4 wasn't PTFed. I can find a V6R1 PTF that seems related -- SI36344 - OSP-CL-RUN-INCORROUT CLLE DOES NOT CORRECTLY HANDLE DEFVAR -- but there might be more appropriate ones. Tom
    125,585 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: