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: 10274
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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