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
 

 

how to match the file using the constants

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

New User


Joined: 20 Jan 2009
Posts: 17
Location: India

PostPosted: Wed Jan 28, 2009 1:55 pm    Post subject: how to match the file using the constants
Reply with quote

hi,
I have a requirement like below..
input file is having single record like
(constant,xxxxxx)
where value 'xxxxxx' value changes after every run

from the other input file, i need to match the records from particular column say col 23-28 ,which has same value as 'xxxxxx' from the first input and include the records in the output file.

since the job will be automated, i can not go and change the SORT card every time. is there any possiblity to match and include the records?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Jan 28, 2009 2:03 pm    Post subject: Reply to: how to match the file using the constants
Reply with quote

You do not have to change anything in the jcl or sort parms,
search the forums for the "two files match"
in Your case the two file to match are ...
1) the big file
2) the file with the single record

3) output ( the file with the records from file 1 that match the single key )
Back to top
View user's profile Send private message
ankit9jain

New User


Joined: 20 Jan 2009
Posts: 17
Location: India

PostPosted: Wed Jan 28, 2009 3:21 pm    Post subject: Reply to: how to match the file using the constants
Reply with quote

hi, i searched the forum but could not get the required result.
could you please help on this?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Jan 28, 2009 3:26 pm    Post subject: Reply to: how to match the file using the constants
Reply with quote

did You search with "two files match sort" ??
there are many many results for it
remember to check the "search for all terms" button
Back to top
View user's profile Send private message
ankit9jain

New User


Joined: 20 Jan 2009
Posts: 17
Location: India

PostPosted: Wed Jan 28, 2009 4:00 pm    Post subject: Reply to: how to match the file using the constants
Reply with quote

sorry, but i again searched the forum but still did not get any idea...
icon_sad.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jan 28, 2009 4:01 pm    Post subject:
Reply with quote

Hi,

here is an example
Code:
//S1       EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *      INPUT FILE1                                   
CONSTANT,XXXXXX                                                   
/*                                                                 
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)   
//SYSIN    DD    *                                                 
  OPTION COPY                                                     
  INREC BUILD=(C'PICKME,''',10,6,C'''',80:X)                       
/*                                                                 
//S2       EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                             
//SORTIN   DD *     INPUT FILE2                                   
A                     XXXXXX         
B                     YYYYYY         
C                     XXXXXX         
/*                                   
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                       
  OPTION COPY                         
  INCLUDE COND=(23,6,CH,EQ,PICKME)   
/*



Gerry
Back to top
View user's profile Send private message
ankit9jain

New User


Joined: 20 Jan 2009
Posts: 17
Location: India

PostPosted: Wed Jan 28, 2009 4:04 pm    Post subject: Reply to: how to match the file using the constants
Reply with quote

thanks a lot ...
but how the "PICKME" isl matching the record?
it would be nice if you explain it a bit..
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jan 28, 2009 4:13 pm    Post subject:
Reply with quote

Hi,

Step S1 creates a symbols dataset which looks like this

Code:
PICKME,'XXXXXX'
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jan 28, 2009 4:21 pm    Post subject:
Reply with quote

Hi,

Oops,I submitted before completing my reply.

Step2 uses SYMNAMES DD which contains the symbol PICKME with a value of XXXXXX, PICKME in the include statement is resolved to XXXXXX.

Please note that my JCL contains 2 SORTOUT DD's. Please remove 1 of them. Duplicate has been removed from example jcl.

Test the example I have provided and you will see in the output the symbol substitution.


Gerry
Back to top
View user's profile Send private message
ankit9jain

New User


Joined: 20 Jan 2009
Posts: 17
Location: India

PostPosted: Wed Jan 28, 2009 10:51 pm    Post subject: Reply to: how to match the file using the constants
Reply with quote

gr8, it is working fine.. thanks a lot
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Wed Jan 28, 2009 11:19 pm    Post subject:
Reply with quote

ankit9jain,

I guess this can be done in a single SYNCSORT JOIN step If you have SyncSort for z/OS 1.2 or higher.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Jan 29, 2009 7:32 am    Post subject:
Reply with quote

Assuming that the single record contains the changing value starting in position 11 for the length of 6, and the master file is FB/80, here is a SyncSort for z/OS JOIN application that will produce the desired output:
Code:
//STEP1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD DSN=output.file,...
//SORTJNF1 DD DISP=SHR,DSN=MASTER.FILE
//SORTJNF2 DD DISP=SHR,DSN=SINGLE.RECORD
//SYSIN    DD *                       
   JOINKEYS FILE=F1,FIELDS=(23,6,A)   
   JOINKEYS FILE=F2,FIELDS=(11,6,A)
   REFORMAT FIELDS=(F1:1,80)
   SORT FIELDS=COPY     
/*

Regards,
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 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


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