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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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