|
|
| Author |
Message |
guruji Warnings : 1 New User
Joined: 13 Apr 2007 Posts: 44 Location: Bangalore
|
|
|
|
hI,
I have a piece of copybook like below:
05 WS-NEW-FLD PIC X(37).
03 WS-DETAILS.
05 WS-LINES OCCURS 0 TO 1000 DEPENDING ON WS-LINE-CNT
INDEXED BY WS-NDX.
07 WS-LINE-TYPE PIC 9(2).
I have to calculate the starting position of WS-LINE-TYPE. How to calculate the length of WS-LINES?It ia a variable length fielda no?
Please help |
|
| Back to top |
|
 |
References
|
Posted: Tue Jul 08, 2008 1:50 pm Post subject: Re: How to calculate the length of a variable length field? |
 |
|
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1504 Location: germany
|
|
|
|
???????????
starting position of ws-line-type(1) is the same as ws-lines.
the length of ws-lines is
length(ws-lines)
or
if ws-line-cnt > 0
then
compute len-ws-lines
= ws-line-cnt * length(ws-line-type)
end-compute
else
move zero to len-ws-lines
end-if |
|
| Back to top |
|
 |
|
|