I have a question on DYNAMIC.
I receive files from different departments and i do not know the file lengths, so i defined it as dynamic like this:
1 #RECORD (A) DYNAMIC
1 #LENGTH (I4)
1 #KEY (A10)
READ WORK FILE 1 #RECORD GIVING LENGTH #LENGTH
the above program gives me the length of each record read as 1467.
BUT, when I change the program a bit I have problems.
READ WORK FILE 1 #RECORD
MOVE SUBSTRING(#RECORD,1,10) TO #KEY
This gives me the error NAT1326 RANGE SPECIFIED IN SUBSTRING OPTION IS OUTSIDE FIELD.
How can i specify the record to be dynamic since i do not know its length and then use that record for manipulation?
Any suggestions are appreciated!!