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 only Detail Records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: sort only Detail Records
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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