JCL sort to compare 2 files and updated field in a file.



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL sort to compare 2 files and updated field in a file.

Postby Sumithdcosta » Sat Feb 20, 2010 2:01 pm

Hello All,

I have 2 files,
File1 is the JCL program with LRECL 80
Eg:-

//JOBCARD XXXXXXXXXXXXXXXXXX
//SYSERROR DD SYSOUT=*
//INPUTDD DD DISP=SHR,DSN=DB2PROD.TXXX.DSTP00AC.P001.G0680V00
//$ORTPARM DD DISP=SHR,DSN=XXXXXXX.TTTTTT.EEE
//SYSIN DD *
XYZ
QWET
/*

File 2 is the PS file with LRECL = 80 with GDG file names inside it.

Eg:-
DB2PROD.TXXX.DSTP01AC.P000.G0692V00
DB2PROD.TXXX.DSTP01AD.P000.G2009V00

OUTPUT should be some what like below.

//JOBCARD XXXXXXXXXXXXXXXXXX
//SYSERROR DD SYSOUT=*
//INPUTDD DD DISP=SHR,DSN=DB2PROD.TXXX.DSTP01AC.P000.G0692V00
//$ORTPARM DD DISP=SHR,DSN=XXXXXXX.TTTTTT.EEE
//SYSIN DD *
XYZ
QWET
/*

Note:-
With GDG Name of file 1 is change with new GDG name from file 2 without changing the rest fields in file 1.

Regards,
Sumith
Sumithdcosta
 
Posts: 5
Joined: Sat Feb 20, 2010 1:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL sort to compare 2 files and updated field in a file.

Postby Sumithdcosta » Sat Feb 20, 2010 2:13 pm

sorry typo... below is corrected question.

I have 2 files,
File1 is the JCL program with LRECL 80
Eg:-

//JOBCARD XXXXXXXXXXXXXXXXXX
//SYSERROR DD SYSOUT=*
//INPUTDD DD DISP=SHR,DSN=DB2PROD.TXXX.DSTP01AC.P002.G0777V00
//$ORTPARM DD DISP=SHR,DSN=XXXXXXX.TTTTTT.EEE
//SYSIN DD *
XYZ
QWET
/*

File 2 is the PS file with LRECL = 80 with GDG file names inside it.

Eg:-
DB2PROD.TXXX.DSTP01AC.P000.G0692V00
DB2PROD.TXXX.DSTP01AD.P000.G2009V00

OUTPUT should be some what like below.

//JOBCARD XXXXXXXXXXXXXXXXXX
//SYSERROR DD SYSOUT=*
//INPUTDD DD DISP=SHR,DSN=DB2PROD.TXXX.DSTP01AC.P000.G0692V00
//$ORTPARM DD DISP=SHR,DSN=XXXXXXX.TTTTTT.EEE
//SYSIN DD *
XYZ
QWET
/*

Note:-
With GDG Name of file 1 is change with new GDG name from file 2 without changing the rest fields in file 1.
Sumithdcosta
 
Posts: 5
Joined: Sat Feb 20, 2010 1:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL sort to compare 2 files and updated field in a file.

Postby Sumithdcosta » Sat Feb 20, 2010 2:37 pm

please provide a SYNCSORT solution?
Sumithdcosta
 
Posts: 5
Joined: Sat Feb 20, 2010 1:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL sort to compare 2 files and updated field in a file.

Postby Sumithdcosta » Sat Feb 20, 2010 3:04 pm

update

Conditions:-
The search for file1 starts from 28 position ,length=21 and should match with the file2 records starting from 1, length 21. If it matches, the record of file1 should be replaced by the records of file 2 starting position 1 to 35.
Sumithdcosta
 
Posts: 5
Joined: Sat Feb 20, 2010 1:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL sort to compare 2 files and updated field in a file.

Postby Sumithdcosta » Tue Feb 23, 2010 1:04 pm

Solution:-

Step1:- convert PDS to PS with LRECL 160
Step2:- add sequence number to original JCL
Step3:- use join keys to compare (File1 and file2) and copy paired and unpaired entries of F1. Overlay the required fields.
Step4:-sort the output with sequence number to get back the original format.
Step5:- move back PS to PDS with LRECL 80.
Sumithdcosta
 
Posts: 5
Joined: Sat Feb 20, 2010 1:12 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post