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

Sort record between tags


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

Moderator


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

PostPosted: Tue May 07, 2013 10:44 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 07, 2013 10:48 pm
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: 1208
Location: Bangalore,India

PostPosted: Tue May 07, 2013 10:53 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top