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

sort only Detail Records


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

New User


Joined: 10 Mar 2005
Posts: 41
Location: United States Of America

PostPosted: Tue Aug 30, 2011 2:12 pm
Reply with quote

I have a file with n number of records including header and trailer.

- Header record being first record of file
- Trailor record being last record of file

First char for Header record starts with H, and Trailor T.

Now I need to sort this file based on 13 digit Account number from column(20 to 32) (excluding header and trailor).
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Aug 30, 2011 2:57 pm
Reply with quote

Hope this helps...

http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.iceg200/ice1cg4053.htm
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue Aug 30, 2011 4:03 pm
Reply with quote

Code:

//TOOLIN   DD *                                             
  DATASORT FROM(SORTIN) TO(OUT) HEADER TRAILER USING(CTL1) 
//CTL1CNTL  DD *                                           
  SORT FIELDS=(20,13,CH,A)                                   
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 30, 2011 4:13 pm
Reply with quote

sameer
If DATASORT does work at your shop.. You can use below..
Assuming record length 80
Code:

//STEP0100 EXEC PGM=SORT                                 
//SORTIN   DD *                                           
H                                                         
370000000030                                             
370000000004                                             
370000000050                                             
370000000001                                             
370000000020                                             
T                                                         
//SORTOUT  DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=(81,1,CH,A,20,13,CH,A)                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'2')),             
        IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),OVERLAY=(81:C'1')),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),OVERLAY=(81:C'3')) 
  OUTFIL BUILD=(1,80)                                     
/*                                                       
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 and retrive records f... DFSORT/ICETOOL 3
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 Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top