Page 1 of 1

Change record by key

PostPosted: Thu Nov 17, 2022 8:23 pm
by PRDVCF
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?

Re: Change record by key

PostPosted: Thu Nov 17, 2022 9:15 pm
by sergeyken
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

Re: Change record by key

PostPosted: Thu Nov 17, 2022 9:58 pm
by PRDVCF
Thank you sergeyken.