Anand78
New User
Joined: 06 Mar 2006 Posts: 50 Location: PUNE
|
|
|
|
hi ,,
I had the following querry, pls help me.
FILE1 layout: 05 DETP pic s9(04) comp.
05 CLASS pic s9(04) comp.
05 ITEM pic s9(04) comp.
FILE2 layout: 05 DETP pic s9(03) .
05 CLASS pic s9(02) .
05 ITEM pic s9(04) .
====> thru sorting how can I refomat the files.
//sortin dd dsn=FILE1,disp=shr
// sortout dd dsn=FILE2,disp=shr
//sysin dd *
Kindly provide me the sort card.
Thanks,
Anand |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
As discussed at:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.3?DT=20060615185603
PIC S9(04) COMP is a 2-byte FI field. PIC S9(nn) is an nn-byte ZD field. So this DFSORT job will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=file1,DISP=SHR
//SORTOUT DD DSN=FILE2,DISP=SHR
//SYSIN DD *
OPTION COPY
INREC FIELDS=(1,2,FI,TO=ZD,LENGTH=3,
4,2,FI,TO=ZD,LENGTH=2,
7,2,FI,TO=ZD,LENGTH=4)
/*
|
But be aware that a 2-byte FI field can have a maximum of 5 digits, so your lengths of 3, 2 and 4 for the output fields may result in truncating leading digits. |
|