View previous topic :: View next topic
|
Author |
Message |
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
My file lrecl=60
in that
position 1 to 15 have alphanumeric key value
position 16 to 22 have comp-3 value
position 37 to 39
position 40 t0 43
How can i convert this comp-3 value into normal format ie ZD?
is my following code is correct for first value position from 16 to 22?
Code: |
//SORT1 EXEC PGM=SORT
//SORTIN DD DSN=Y000263.RMSFEED.FILE1,DISP=SHR
//SORTOUT DD DSN=Y000263.QTRAN.RTK14,
// UNIT=DATA,DISP=(,CATLG,DELETE),
// SPACE=(CYL,(500,50),RLSE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,15,CH,A)
OUTREC FIELDS=(15:16,7,PD,TO=ZD,LENGTH=7)
/* |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What happens when you run this?
If you haven't, why not?
You are your own best resource when working thru something like this |
|
Back to top |
|
|
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
wouldnt ur data get truncated ????????
and wats would be the point i having the data without the Key ??? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
position 16 to 22 have comp-3 value |
That's a 7-byte PD field so it can have 13 digits. As smijoss indicated, using LENGTH=7 can result in truncation since the output field will only have the last 7 digits of the 13 digits. If you want all of the digits, use LENGTH=13 (or don't use LENGTH and DFSORT will use the correct length automatically). |
|
Back to top |
|
|
|