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

Sorting without Header - DFSORT tips


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

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Tue Oct 27, 2009 11:24 pm
Reply with quote

Hi,

I want to sort a 'N' number of records without affecting the header part of the file.
For Example, I have a fille with header and data portion.
XXXXXXX - Header part
ZZZZZZZ - Data Part
TTTTTTTT - Data Part
DDDDDD - Data Part
BBBBBBB - Data Part
AAAAAAA - Data Part

After sorting, my header part should remain the same. It should not be touched (I mean it should not be sorted along with the data portion). Only the Data portion alone be sorted.
My Output should be,
XXXXXXX
AAAAAAA
BBBBBBB
DDDDDDD
TTTTTTT
ZZZZZZZ

Please help me out with single DFSORT step.

Note:- No Icetool is used. DFSORT is the only option to be used.

Thanks,
Ashok Kumar.K
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 27, 2009 11:37 pm
Reply with quote

ashok4u_it,

Quote:

Please help me out with single DFSORT step. Note:- No Icetool is used. DFSORT is the only option to be used.


I don't get this. ICETOOL is part of DFSORT. ICETOOL has been shipped with DFSORT since 1991!
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Tue Oct 27, 2009 11:49 pm
Reply with quote

Oops... Everytime, I used to get the statement as "ICETOOL IS A PART OF DFSORT"... Yup, I know it is a part of DFSORT. But, i do have some restrictions in using ICETOOL statements in my work place. Please believe and understand me. But, no reasons yet from my admin.

Thanks
Ashok Kumar.K
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Oct 28, 2009 12:37 am
Reply with quote

ashok4u_it,

The following DFSORT JCL will give you the desired results. I assumed that your input is FB recfm and 80 bye LRECL and your key to be sorted is first 9 bytes.

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
XXXXXXX  - HEADER PART                                   
ZZZZZZZ  - DATA PART                                     
TTTTTTTT - DATA PART                                     
DDDDDD   - DATA PART                                     
BBBBBBB  - DATA PART                                     
AAAAAAA  - DATA PART                                     
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),     
  IFTHEN=(WHEN=(81,8,ZD,GT,1),OVERLAY=(81:C'2'))         
  SORT FIELDS=(81,1,CH,A,1,9,CH,A),EQUALS                 
  OUTREC BUILD=(1,80)                                     
/*


The output of this is

Code:

XXXXXXX  - HEADER PART   
AAAAAAA  - DATA PART     
BBBBBBB  - DATA PART     
DDDDDD   - DATA PART     
TTTTTTTT - DATA PART     
ZZZZZZZ  - DATA PART     
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Oct 28, 2009 1:02 am
Reply with quote

Thats,

Really cool icon_smile.gif
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Tue Nov 03, 2009 11:27 pm
Reply with quote

Thanks a lot Skolusu. It works fine. Thanks for ur help.

Regards
Ashok K.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top