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: 1255
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: 3053
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top