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
 

 

Sort JCL to search whether these values are present

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Fri Dec 26, 2008 8:17 pm    Post subject: Sort JCL to search whether these values are present
Reply with quote

Hi All,

I need your help. I have two input files.find below.

Input file1:
123
456
789

Input File2:
GARS123
GRAS456
SARG789

So now using the the values of the first input file, i have to search whether these values are present in the second input file, if so the entire values from input file2 (For Ex : GARS123) need to be placed in output file.

Like wise needs to search for all the values in the input file1.

Hope the above issue is clear enough.
Back to top
View user's profile Send private message

ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Dec 26, 2008 9:15 pm    Post subject: Try this
Reply with quote

raj12vel,

Try this.....

Code:

//SORT01   EXEC PGM=SORT         
//SORTJNF1 DD  *                 
123                             
456                             
789                             
//SORTJNF2 DD  *                 
GARS123                         
GRAS456                         
SARG789                         
SARG890                         
//SORTOUT  DD  SYSOUT=*         
//SYSIN    DD  *                 
  JOINKEYS FILE=F1,FIELDS=(1,3,A)
  JOINKEYS FILE=F2,FIELDS=(5,3,A)
  REFORMAT FIELDS=(F2:1,7)       
  SORT FIELDS=COPY               
  END                           
/*                               


Output:
Code:

GARS123
GRAS456
SARG789


HTH.
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Fri Dec 26, 2008 9:28 pm    Post subject:
Reply with quote

Great. Working fine.

thnaks alot.

can i see the output in the new output file. If so, how to give the same in the code
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Fri Dec 26, 2008 10:20 pm    Post subject:
Reply with quote

I got it. Thanks for your timed help.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sun Dec 28, 2008 2:00 pm    Post subject: Reply to: Sort JCL to search whether these values are presen
Reply with quote

glad that I could help icon_smile.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
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 Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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