Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 5 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us