what is the difference between based or defined variables?
How do i define sub-level varibales for this requirement?
Given the following definition:
DCL SET CHAR (100);
The following areas are to be accessed with the help of overlays.
- from position 1 there is a 4-digit personnel number in binary format
- from position 3 on, there is the name (NAME) in the length of 15 bytes, followed by the first name (VNAME) in the same length
- from position 68 there is a 5-digit amount (BETR) with 2 decimal places (--> 5 VK, 2 NK) in unpacked format
- from position 81 there are 10 numbers in unpacked format of 2 bytes length each
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
BASED variables are addressed using POINTERS or ADDRESS of, A DEFined variable is defined on an absolute POSition within another variable. I find based variables preferable since a change of an underlying variable will result in recalculation of the address/pointer while something defined an an absolute position does not change its offset.
Several ways of overlaying... though using SET as a variable name is a BAD idea...
BASED variables are addressed using POINTERS or ADDRESS of, A DEFined variable is defined on an absolute POSition within another variable. I find based variables preferable since a change of an underlying variable will result in recalculation of the address/pointer while something defined an an absolute position does not change its offset.
Several ways of overlaying... though using SET as a variable name is a BAD idea...
You can calculate the size of the fillers. Also, please use code tags where appropriate - as I have done.
Garry.
Thanks Garry. I am learning PL1 and trying to learn it with your solutions and then refering them back to the manual also. This helps me understand the manual better. THANK YOU.