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

Need help on Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Mar 05, 2012 8:29 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top