60 pts.
 Did anyone use DATA structures In CL
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.

Software/Hardware used:
ASKED: September 11, 2008  7:38 AM
UPDATED: July 30, 2010  9:31 PM

Answer Wiki:
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.
Last Wiki Answer Submitted:  July 24, 2009  4:15 pm  by  Yorkshireman   5,505 pts.
All Answer Wiki Contributors:  Yorkshireman   5,505 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 107,995 pts.

 

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.

 5,525 pts.

 

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

 107,995 pts.