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 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: 10327
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
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