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?
Change record by key
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Change record by key
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 1Code: Select all
000001 ATMLERH
000002 ATMTRNAC
000003 CMAILRH
000004 DB2FREPK
000005 DB2LOGMB
File 2Code: Select all
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.
Re: Change record by key
Thank you sergeyken.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
SORT to add trailer record on change of key + Date
by Prashant_2021 » Fri Aug 27, 2021 11:04 pm » in DFSORT/ICETOOL/ICEGENER - 1
- 1656
-
by sergeyken
View the latest post
Sat Aug 28, 2021 11:15 pm
-
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4115
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-
-
- 24
- 4335
-
by Pedro
View the latest post
Wed Jan 04, 2023 5:59 am
-
- 1
- 1234
-
by willy jensen
View the latest post
Sat Sep 04, 2021 12:51 am
-
-
Reorg SYSIBM tables to reduce extents (XT) - change priqty &
by TechnoCaveman » Thu Feb 17, 2022 7:46 pm » in DB2 - 2
- 3731
-
by sergeyken
View the latest post
Thu Sep 22, 2022 4:49 pm
-