Change record by key



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

Change record by key

Postby PRDVCF » Thu Nov 17, 2022 8:23 pm

I have two equal files ( Dsorg=PS and RecFm=FB ). The first file just have records from 1 to 8. The second have from 1 to 132

File 1
000001 ATMLERH
000002 ATMTRNAC
000003 CMAILRH
000004 DB2FREPK
000005 DB2LOGMB

File 2
000001 ATMLERH COBCICAAB6AATMISA
000002 ATMTRNACCOBCICNAB6AATMGRL
000003 CMAILRH COBCICAAB6AGRL
000004 DB2FREPKCOBBA2AAA6ASYS
000005 DB2LOGMBCOBBA2AAA6ASYS

What I need is change in file 2 all char's on column 18 ( as example ), but only the records founded in file 1.
I have this by clist, which submits a job for each record. That's not so productive as make this only one time.
Does anyone knows how to do it in other way?
PRDVCF
 
Posts: 6
Joined: Thu Nov 17, 2022 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Change record by key

Postby sergeyken » Thu Nov 17, 2022 9:15 pm

PRDVCF wrote:I have two equal files ( Dsorg=PS and RecFm=FB ). The first file just have records from 1 to 8. The second have from 1 to 132

Those are DATASETS, never FILES.
In mainframe world the word "file" is somehow equivalent to "DDNAME".
What you are talking about, are DATASETS, identified by their DSNAMES.

PRDVCF wrote:File 1
000001 ATMLERH
000002 ATMTRNAC
000003 CMAILRH
000004 DB2FREPK
000005 DB2LOGMB


File 2
000001 ATMLERH COBCICAAB6AATMISA
000002 ATMTRNACCOBCICNAB6AATMGRL
000003 CMAILRH COBCICAAB6AGRL    
000004 DB2FREPKCOBBA2AAA6ASYS    
000005 DB2LOGMBCOBBA2AAA6ASYS    
 


PRDVCF wrote:What I need is change in file 2 all char's on column 18 ( as example ), but only the records founded in file 1.
I have this by clist, which submits a job for each record. That's not so productive as make this only one time.
Does anyone knows how to do it in other way?


You cannot do anything like this using JCL.

You need to get some knowledges about SORT utilities. (Hint: JOIN operation)

https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3sc236880/$file/iceg200_v2r3.pdf
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Change record by key

Postby PRDVCF » Thu Nov 17, 2022 9:58 pm

Thank you sergeyken.
PRDVCF
 
Posts: 6
Joined: Thu Nov 17, 2022 7:56 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post