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
 

 

Help in need in SORT JCL

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

New User


Joined: 22 Aug 2005
Posts: 59
Location: india

PostPosted: Fri Jun 27, 2008 11:26 am    Post subject: Help in need in SORT JCL
Reply with quote

I have two files like below

File1 : here XYZ,PQR,WWW,ZZZ,YYY should be compared with second file key values

ABCDEFGHIJKLMXYZ123123
ABCDEFGHIJKLMXYZ12367676
ABCDEFGHIJKLMXYZ123567567
ABCDEFGHIJKLMXYZ12345645
ABCDEFGHIJKLMPQR123123
ABCDEFGHIJKLMPQR12367676
ABCDEFGHIJKLMPQR123567567
ABCDEFGHIJKLMPQR12345645
ABCDEFGHIJKLMWWW123123
ABCDEFGHIJKLMWWW12367676
ABCDEFGHIJKLMZZZ123123
ABCDEFGHIJKLMZZZ12367676
ABCDEFGHIJKLMYYY123123
ABCDEFGHIJKLMYYY12367676

File2:- in this file the key field position was first three characters

XYZ
PQR
WWW


Out put should be

Match records from File1:-

ABCDEFGHIJKLMXYZ123123
ABCDEFGHIJKLMXYZ12367676
ABCDEFGHIJKLMXYZ123567567
ABCDEFGHIJKLMXYZ12345645
ABCDEFGHIJKLMPQR123123
ABCDEFGHIJKLMPQR12367676
ABCDEFGHIJKLMPQR123567567
ABCDEFGHIJKLMPQR12345645
ABCDEFGHIJKLMWWW123123
ABCDEFGHIJKLMWWW12367676

Un matched records from file1

ABCDEFGHIJKLMZZZ123123
ABCDEFGHIJKLMZZZ12367676
ABCDEFGHIJKLMYYY123123
ABCDEFGHIJKLMYYY12367676



How can i get the above result from the input.
Pleae help me out in this problem.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jun 27, 2008 9:48 pm    Post subject:
Reply with quote

sathish_rathinam,

The following DFSORT/ICETOOL JCl will give you the desired results. I assumed that your input files are of FB recfm and 80 bytes in length. The matching key in file 1 is pos 14 for 3 bytes and in file 2 it is in pos 1 for 3 bytes



Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD *                                               
ABCDEFGHIJKLMXYZ123123                                       
ABCDEFGHIJKLMXYZ12367676                                     
ABCDEFGHIJKLMXYZ123567567                                     
ABCDEFGHIJKLMXYZ12345645                                     
ABCDEFGHIJKLMPQR123123                                       
ABCDEFGHIJKLMPQR12367676                                     
ABCDEFGHIJKLMPQR123567567                                     
ABCDEFGHIJKLMPQR12345645                                     
ABCDEFGHIJKLMWWW123123                                       
ABCDEFGHIJKLMWWW12367676                                     
ABCDEFGHIJKLMZZZ123123                                       
ABCDEFGHIJKLMZZZ12367676                                     
ABCDEFGHIJKLMYYY123123                                       
ABCDEFGHIJKLMYYY12367676                                     
//IN2      DD *                                               
XYZ                                                           
PQR                                                           
WWW                                                           
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//MATCH    DD SYSOUT=*                                       
//UNMATCH  DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  COPY FROM(IN2) USING(CTL1)                                 
  COPY FROM(IN1) USING(CTL2)                                 
  SPLICE FROM(T1) TO(MATCH) ON(14,3,CH) KEEPNODUPS KEEPBASE -
  WITHALL WITH(01,80) USING(CTL3)                             
//CTL1CNTL DD *                                               
  OUTFIL FNAMES=T1,BUILD=(14:1,3,81:C'22',1,3)               
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=T1,OVERLAY=(81:C'11',3X)                     
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=MATCH,BUILD=(1,80),                           
  INCLUDE=(81,2,CH,EQ,C'22',AND,(14,3,CH,EQ,83,3,CH,AND,     
            1,13,CH,NE,C' '))                                 
  OUTFIL FNAMES=UNMATCH,BUILD=(1,80),                         
  INCLUDE=(81,2,CH,EQ,C'11')                                 
/*


Hope this helps...

Cheers
Back to top
View user's profile Send private message
sathish_rathinam

New User


Joined: 22 Aug 2005
Posts: 59
Location: india

PostPosted: Mon Jun 30, 2008 10:20 am    Post subject:
Reply with quote

Hi Skolusu,

Icetool job given by you works fine.Thanks alot.

Regards,
Sathish
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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