Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us