IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Merge 2 input files based on the records of 2nd input file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
themants

New User


Joined: 11 Aug 2022
Posts: 9
Location: india

PostPosted: Thu Feb 16, 2023 9:51 am
Reply with quote

I have 2 files. For the specific condition match in 2nd file, I need to skip the relevant account details from file 1 as well in the output file but all records besides skipped account number from file 1 must be present in output file.
**************************
File 1 input -
ACC0001RNB
ACC0002RNB
ACC0003RNB
ACC0004RNB
ACC0005RNB
ACC0006RNB
**************************
File 2 input -
ACC0001C01
ACC000203L
ACC0002C03
ACC0003139
ACC0003A11
ACC0004C04

Here, for each account number, for position no 8, if we have 'C0' and '3' or '4' at 10th position, we don't need the relevant record from file 1 but all records beside those from File 1.
**************************
Expected output -
ACC0001RNB
ACC0003RNB
ACC0005RNB
ACC0006RNB
**************************
i have tried below OMIT login and relevant include logic by changing the logic part but its still giving me account number AC0002 in output file which is not required.

SORT FIELDS=(1,7,CH,A)
JOINKEYS FILE=F1,FIELDS=(1,7,A)
JOINKEYS FILE=F2,FIELDS=(1,7,A)
OMIT COND=(8,2,CH,EQ,C'C0',AND,
(12,1,CH,EQ,C'3',OR,12,1,CH,EQ,C'4'))
REFORMAT FIELDS=(F1:1,489),FILL=C'

Can anyone help me resolve this?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Thu Feb 16, 2023 10:03 am
Reply with quote

See your first topic for a possible solution.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Feb 16, 2023 12:45 pm
Reply with quote

Please stop posting same question in two different sections of this forum. Topic locked.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top