Please help me a sort for changing the string by matching the account in input file A & B
Input file:
A/
1 postion and length 1 : H
18 postion and length 4 : PNOC
26 postion and lenght 10 : Account
B/Need to match to the input file with starting 1 position to length 10
The input files are having RECFM=FB and LRECL=424
Matching criteria:
1/match the accounts in Input file A: Start position 26 and Length 10 with Accounts in Input file B
2/and 1st position letter is H
Once it matches the accounts in both the files and replace the PNOC to PPNN in postion 18 and length 4
into the output file..
For ex:
Input file A:
----+----1----+----2----+----3----+----4--
H0001000017601855PNOC1004J559274890
S0024000017600323
S0023000017600323
H0001000017631106PNOC1002J053242468
P0001000017601855
P0002000017601855
H0001000017649369PNOC1001J393673513187889392
CH001000017631106
CD001000017631106
D000600001763110620111209233338
D000100001763110620111201121001 182552768
Input file B:
----+----1----+----2----+----3----+----4--
J559274890
J053242468
Output file:
----+----1----+----2----+----3----+----4--
H0001000017601855PPNN1004J559274890
S0024000017600323
S0023000017600323
H0001000017631106PPNN1002J053242468
P0001000017601855
P0002000017601855
H0001000017649369PNOC1001J393673513187889392
CH001000017631106
CD001000017631106
D000600001763110620111209233338
D000100001763110620111201121001 182552768
Need a easytrieve logic of matching and replace a string
Moderators: DikDude, Moderator Group
-
- Member
- Posts: 1
- Joined: Wed Dec 21, 2011 12:17 pm
Hopefully, you are not looking for someone to write the code for you. . . These are Help forums rather than do-my-work-for-me forums. . .
When posting code, data, jcl, info from a screen, etc, you need to use the Code tagOtherwise alighment is lost and readability awful. . . "Wrap" your info to be Code'd between (code) and (/code) using [] instead of (). Use the Preview to see your post as it will appear to the forum rather than how it appears in the Reply editor. Then Submit when your post appears the way you want.
What is the maximum number (if any) of the records in file B?
When posting code, data, jcl, info from a screen, etc, you need to use the Code tag
Code: Select all
----+----1----+----2----+----3----+----4--
H0001000017601855PNOC1004J559274890
S0024000017600323
S0023000017600323
H0001000017631106PNOC1002J053242468
P0001000017601855
P0002000017601855
H0001000017649369PNOC1001J393673513187889392
CH001000017631106
CD001000017631106
D000600001763110620111209233338
D000100001763110620111201121001 182552768
What is the maximum number (if any) of the records in file B?
Have a good one
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page