Reputation: 11
As the title implies, I don't know what the fully free form version of the following data structure should be:
DQUSVR4 DS
D QUSLVR00 1 4I 0
D QUSCK 5 8I 0
D QUSLD 9 12I 0
I understand the old '5I 0', '10I 0', etc. integer specifications, which I did find references to on IBM's side. And I did find an IBM reference that seemed to equate 4I with a four byte integer (10I), and 8I with an eight byte integer (20I) for an input specification. But what's the 12I 0, then? Color me confused.
For context, this data structure can be found in the QUS source member of the QSYSINC/QRPGLESRC file, and is used when working with user spaces.
I appreciate any clarification on these specifications.
Upvotes: 0
Views: 35
Reputation: 453
Dcl-DS QUSVR4;
QUSLVR00 Int(10) Pos(1);
QUSCK Int(10) Pos(5);
QUSLD Int(10) Pos(9);
End-DS;
When you decribe programm defined data structure subfield the first digit (1, 5, 9) means the start position, second digit (4, 8, 12) means the end position of subfield. Then follows letter means type of subfield and finally digit (for numeric types) means decimal positions.
Since the fields of the structure follow one another without gaps between them using pos in this case is redundant. You can simply
Dcl-DS QUSVR4;
QUSLVR00 Int(10);
QUSCK Int(10);
QUSLD Int(10);
End-DS;
Upvotes: 1