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
 

 

Create Group Headers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Wed May 11, 2011 2:15 pm    Post subject: Create Group Headers
Reply with quote

Hi,

I have a file with length 80 and format FB - with a counter of 3 bytes in positions 1-3, followed by a space, followed by a identifier string of 2 byte character data.

Input file

001 AA
002 AA
003 AA
001 BB
009 BB
005 CC
007 CC

I need to create an output file such that the identifier string gets written as a header record for the group of records. So, the output will be:

AA
001
002
003
BB
001
009
CC
005
007

Can thiis be done using sort?

Thanks,
Aneesh.
Back to top
View user's profile Send private message

Escapa

Senior Member


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

PostPosted: Wed May 11, 2011 4:02 pm    Post subject:
Reply with quote

Below step will give required output...

Code:

//STEP10   EXEC PGM=SORT                                           
//SORTIN       DD *                                                 
001 AA                                                             
002 AA                                                             
003 AA                                                             
001 BB                                                             
009 BB                                                             
005 CC                                                             
007 CC                                                             
/*                                                                 
//SORTOUT DD SYSOUT=*                                               
//SYSOUT  DD SYSOUT=*                                               
//SYSIN    DD  *                                                   
  SORT FIELDS=(5,2,CH,A)                                           
  OUTFIL REMOVECC,SECTIONS=(5,2,HEADER3=(5,2,80:X)),BUILD=(1,3,80:X)
/*                                                                 


Output,
Code:
AA 
001
002
003
BB 
001
009
CC 
005
007
Back to top
View user's profile Send private message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Wed May 11, 2011 4:13 pm    Post subject: Reply to: Create Group Headers
Reply with quote

Thanks a lot icon_smile.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Wed May 11, 2011 4:26 pm    Post subject: Re: Reply to: Create Group Headers
Reply with quote

Aneesh wrote:
Thanks a lot icon_smile.gif

Cheers... icon_smile.gif
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 Sorting group data rajella DFSORT/ICETOOL 3 Sun Jan 22, 2017 11:32 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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