IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort to reformat files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Thu Dec 07, 2006 9:04 pm
Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 07, 2006 11:19 pm
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top