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
 

 

Sort record between tags

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

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue May 07, 2013 10:44 pm    Post subject: Sort record between tags
Reply with quote

Hi All,

I have one i/p with variable length which have records between tag:

Code:
CP
1234 DTl
1 provider 12/03/2012
123  Access 1/2/2012  I N
C#P
AP
1234 ABC
1 provider 12/03/2012
A#P
CP
1234 DTl
1 provider 12/03/2012
123  Access 1/2/2012  I N
C#P
DP
1 provider 12/03/2012
D#P
CP
123 DTl
1 provider 12/03/2012
123 DTl
C#P
DP
1 provider 12/03/2012 1/4/2012
D#P
AP
1234 ABC
A#P
CP
123 DTl
1 provider 12/03/2012
123 DTl
C#P

Output shd be
Code:
AP
1234 ABC
1 provider 12/03/2012
A#P
AP
1234 ABC
A#P
CP
1234 DTl
1 provider 12/03/2012
123  Access 1/2/2012  I N
C#P
CP
1234 DTl
1 provider 12/03/2012
123  Access 1/2/2012  I N
C#P
CP
123 DTl
1 provider 12/03/2012
123 DTl
C#P
CP
123 DTl
1 provider 12/03/2012
123 DTl
C#P
DP
1 provider 12/03/2012
D#P
DP
1 provider 12/03/2012 1/4/2012
D#P


Here every record is in multiple lines . All the record are in between tags
Code:
AP
A#P

OR
Code:

CP
C#P

OR
Code:

DP
D#P


Need to group the records like all the A records should come first followed by C and than D
Please advise.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Tue May 07, 2013 10:48 pm    Post subject: Reply to: Sort record between tags
Reply with quote

are the tags fixed or <arbitrary>
since there is no record type to be analyzed You will have to specify each group limit by hand
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue May 07, 2013 10:53 pm    Post subject:
Reply with quote

Hello enrico,

Yes there are only three tags. A D and C only.Its variable length file and no specific record type. Just wanted to similar record type group together
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue May 07, 2013 11:42 pm    Post subject:
Reply with quote

guptae wrote:
Hello enrico,

Yes there are only three tags. A D and C only.Its variable length file and no specific record type. Just wanted to similar record type group together


You need to provide more than that. Assuming your group indicators AP,CP,DP and A#P, C#P, D#P start at position 5 here is a JCL & sort control which will give you the desired results.
Code:

//STEP0200 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DISP=SHR,DSN=Your Input VB file
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,2X,5)),           
  IFTHEN=(WHEN=GROUP,BEGIN=(7,2,SS,EQ,C'AP,CP,DP'),   
  END=(7,3,SS,EQ,C'A#P,C#P,D#P'),PUSH=(5:7,2))         
  SORT FIELDS=(5,2,CH,A),EQUALS                       
  OUTREC BUILD=(1,4,7)                                 
//*
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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