Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort to reformat files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort to reformat files
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 Moderator


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

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

As discussed at:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us