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
 

 

Need help on Sort

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

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Mar 05, 2012 8:12 pm    Post subject: Need help on Sort
Reply with quote

Hello All,

I have the below requirement. Please let me know how can be done through sort

Input file :

Code:
JH                            A01
JL   A               X
JL   B               Z
JL   M               R
JH                            B01
JL   K               D
JL   L                T
JL   N                L


Output file :

Code:
JL   A               X      A01
JL   B               Z      A01
JL   M               R      A01
JL   K               D      B01
JL   L                T      B01
JL   N                L      B01


input record layout :
Code:
JH, JL (1,2 ) ( Start pos,Length )
A,B,M,K,L,N ( 6,1) ( Start pos,Length )
X,Z,R,D,T,L ( 22,1 ) ( Start pos,Length )
A01,B01 ( 29,3 ) ( Start pos,Length )

That is A01,B01 ( 29,3 ) ( Start pos,Length ) from each JH record repeats for the JL records respectively.



Let me know if I can provide more information.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Mon Mar 05, 2012 8:29 pm    Post subject: Reply to: Need help on Sort
Reply with quote

after 2 years You should have been able to do something on your own
( the form contains a few example )

but You could try with something like


Code:
 000004 //S1      EXEC PGM=SORT                                                 
 000005 //SYSPRINT  DD SYSOUT=*                                                 
 000006 //SYSOUT    DD SYSOUT=*                                                 
 000007 //SORTIN    DD *                                                       
 000008 JH                  A01                                                 
 000009 JL   A    X                                                             
 000010 JL   B    Z                                                             
 000011 JL   M    R                                                             
 000012 JH                  B01                                                 
 000013 JL   K    D                                                             
 000014 JL   L    T                                                             
 000015 JL   N    L                                                             
 000016 //SORTOUT   DD SYSOUT=*,                                               
 000017 //             DCB=(RECFM=FB,LRECL=80)                                 
 000018 //SYSIN     DD *                                                       
 000019   SORT   FIELDS=COPY                                                   
 000020   INREC  IFTHEN=(WHEN=GROUP,BEGIN=(01,02,CH,EQ,C'JH'),PUSH=(21:21,5))   
 000021   OUTFIL OMIT=(01,02,CH,EQ,C'JH')                                       
 000022 //*                                                                     


modify to use Your own positions and lengths
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Tue Mar 06, 2012 4:53 pm    Post subject:
Reply with quote

Thanks Enrico
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 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
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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