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
 

 

Cycle no in each files

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

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Sun Mar 16, 2008 8:08 am    Post subject: Cycle no in each files
Reply with quote

hi,
I have 2 files,one has 1 rec and other has many records.
File 1
------
REGIONA123

File2
-----
12012008regiona123
11111
22222
33333
44444

My requirement is to compare the cycle no in each file and if match should return code 0 and not match rc 4 and change the file1 to match file2 using SYNCSORT only.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Mar 16, 2008 11:46 am    Post subject:
Reply with quote

Hi,

This can be done but what is 'cycle no.', there is no reference of this in Your files shown, is it 'regiona123'?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sun Mar 16, 2008 11:56 am    Post subject:
Reply with quote

assuming that the Cycle no. is REGIONA123.
Is that the Cycle no. may be present in any position in your second file?
What is the RECFM and LRECL of your input and o/p files?
Back to top
View user's profile Send private message
Unique

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Sun Mar 16, 2008 2:44 pm    Post subject:
Reply with quote

Hi,
In the input file FILE 1 , there is only one record with the data as <Region><Cycle NO>.
REGIONA is the test region and cycle no is 123 and the length is 80 FB

the second file contains the
first record as <Date><Region><CYCLE NO>
and the rest of the records have data for that cycleno

i need to match the cycle no in both the files and if matching ,i should be get RC=0 and if notmatching, set RC=4 and change the cycle no in the file1 same as second file.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sun Mar 16, 2008 4:46 pm    Post subject:
Reply with quote

Hi
Code:
//********************************************************************
//SORT1    EXEC PGM=SYNCSORT                                         
//SORTJNF1 DD DSN=HLQ.TEST.FB80,DISP=SHR                         
//SORTJNF2 DD *                                                       
12012008REGIONA123                                                   
11111                                                                 
22222                                                                 
33333                                                                 
44444                                                                 
//SORTOUT  DD DSN=&&TEMP,DISP=(,PASS),UNIT=SYSDA                     
//SORTOF01 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  JOINKEYS FILE=F1,FIELDS=(8,3,A)                                     
  JOINKEYS FILE=F2,FIELDS=(16,3,A)                                   
  REFORMAT FIELDS=(F2:9,10)                                           
  SORT FIELDS=COPY                                                   
  OUTFIL FILES=01,INCLUDE=(1,6,CH,EQ,C'REGION'),NULLOFL=RC4,         
         OVERLAY=(80:C' ')                     
//*                                           
//SORT2  EXEC PGM=SORT,COND=(04,EQ,SORT1)     
//SORTIN DD  DSN=&&TEMP1,DISP=(MOD,PASS,DELETE)
//SORTOUT DD DSN=HLQ.TEST.FB80,DISP=SHR   
//SYSOUT  DD SYSOUT=*                         
//SYSIN  DD *                                 
 OPTION COPY         


Explanaion:
in step SORT1 the DD SORTJNF1 contains your first file contents
Code:
REGIONA123


DD SORTJNF2 will contain the second file contents.

JOINKEYS will match the keys, the OUTFIL will set return code 00 if the key matched else returns 04.
The step SORT2 will excecute only if the step SORT1 returns 04. This step when excecuted will update the latest key from second file to first file.

Hope this is what you wanted!!! icon_cool.gif
Back to top
View user's profile Send private message
Unique

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Sun Mar 16, 2008 9:18 pm    Post subject:
Reply with quote

I will try your solution and will let you know.
Back to top
View user's profile Send private message
Unique

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Mon Mar 17, 2008 2:31 am    Post subject:
Reply with quote

Hi Krisprem,
I tried ur solution .I am able to get rc=0 if the cycle no matchs and rc=4,when cycle no mismatches. But when there is a mismatch,the input file1 is not updated with the cycle no of file2. Please guide

Thanks
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Tue Mar 18, 2008 2:31 am    Post subject:
Reply with quote

Unique,

Try the modified second step I emailed you with COND=(04,NE,SORT1).
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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