Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Match from 1st file and write the 2nd file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 6:11 pm    Post subject: Match from 1st file and write the 2nd file
Reply with quote

FIle1
Code:

BABY12345
BOBY12345
POPY12345
JABBY7765   


File2
Code:

ABBY45678
BABY09875   CA
JABBY5566   DR
JABBY1123   GA
LABBY9900
QABY1100
BABY00997   DR
POPY00998   CA
POPY22334   MA



Output should be
File3
Code:

BABY09875   CA
JABBY5566   DR
BABY00997   DR
POPY00998   CA



First 4 char is the keys for file1 and file2.File2 has to match with file1 with keys(1,4) and File2 to have either CA or DR. (or) File 1 has to match with File2 with keys(1,4) and file 2 have to have either CA or DR.


Could someone tell me the possible way to get this kind of output.
I have spend lot of effort to do this. but still the output is not as expected.

Thanks in advance.
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat Mar 09, 2013 6:20 pm    Post subject:
Reply with quote

And now?
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 6:22 pm    Post subject:
Reply with quote

Peter,

please find my updated post.

Thanks
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 6:56 pm    Post subject:
Reply with quote

Could someone help me out?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sat Mar 09, 2013 7:00 pm    Post subject: Reply to: Match from 1st file and write the 2nd file
Reply with quote

JOINKEYS will do the matching for you. INCLUDE on a JNFnCNTL file can be used to only match the CA/DR.

File 2 matching File 1 is the same as File 1 matching File 2, so I'm not sure why you repeated it.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Mar 09, 2013 7:52 pm    Post subject: Reply to: Match from 1st file and write the 2nd file
Reply with quote

what happened to
http://ibmmainframes.com/viewtopic.php?t=60553&highlight=

shall I delete it ???
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 8:22 pm    Post subject:
Reply with quote

Hi Enrico,

please delete the below topic.

http://ibmmainframes.com/viewtopic.php?t=60553&highlight=

Can you please provide me a snippet for this topic?

Thanks,
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 8:24 pm    Post subject:
Reply with quote

Hi Bill Woodger,

can you please help me with an example?

it will be helpful

Thanks,
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Mar 09, 2013 8:35 pm    Post subject: Reply to: Match from 1st file and write the 2nd file
Reply with quote

please stop soliciting for replies

You should remember that
replying is on voluntary base
on our own time
free of charge

in less PC words when and if we feel like

and furthermore is saturday

for a question like the current one there are even too many examples on the forum

do a bit of research
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 9:00 pm    Post subject:
Reply with quote

icon_sad.gif icon_sad.gif icon_sad.gif icon_cry.gif

Examples in forums are confusing like anything.

Can any one please give an example for my requirement?

wanna go home????
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sat Mar 09, 2013 9:19 pm    Post subject: Reply to: Match from 1st file and write the 2nd file
Reply with quote

Code:

  JOINKEYS F1=INA,FIELDS=(1,4,A)         
  JOINKEYS F2=INB,FIELDS=(1,4,A)         
  REFORMAT FIELDS=(F1:1,12,F2:13,2)
  OPTION COPY

//JNF2CNTL DD *
  INCLUDE COND=(13,2,SS,EQ,C'CA,DR')
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 9:45 pm    Post subject:
Reply with quote

getting this error
Code:

       JOINKEYS F1=INA,FIELDS=(1,10,A)         
                *                             
       JOINKEYS F2=INB,FIELDS=(1,10,A)         
                *                             
       REFORMAT FIELDS=(F1:1,10,F2:36,5465)   
       OPTION COPY                             
 WER268A  JOINKEYS STATEMENT: SYNTAX ERROR     
 WER268A  JOINKEYS STATEMENT: SYNTAX ERROR     
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 10:23 pm    Post subject:
Reply with quote

Bill Woodger


Thank you so much for your help.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sat Mar 09, 2013 10:28 pm    Post subject: Reply to: Match from 1st file and write the 2nd file
Reply with quote

Change F1 and F2 to FILES=F1 and F2
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Sat Mar 09, 2013 10:31 pm    Post subject:
Reply with quote

it is working fine..

Thanks again
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sun Mar 10, 2013 4:22 am    Post subject: Reply to: Match from 1st file and write the 2nd file
Reply with quote

For non-SyncSort 1.4 users, move the INCLUDE to OUTFIL INCLUDE=.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us