Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Match files and replace the value with other file

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

New User


Joined: 14 Nov 2007
Posts: 36
Location: Chennai

PostPosted: Fri Mar 05, 2010 3:51 am    Post subject: Match files and replace the value with other file
Reply with quote

Could any one please help me to solve the below query as mentioned with example. My query is Reading 2 input files and writing into output file by replacing the blank value from input1,Key is Policy #.

Input1:
Code:


Policy #                          Value
(Pos 20 - 30)            (Pos 35 - 44)
----------------------------------------
AB12                          SUBBU
AB13                          KRIS
AB14                          MAC



Input2:
Code:


RecId          Policy #         Text                   Value
(Pos 1-19)  (Pos 20 - 30)   (Pos 31 -34)    (Pos 35 - 44)
---------------------------------------------------------------
1                AB12              NH                SUBBU
2                AB12              NH               
3                AB13              MS                KRIS
4                AB13              MS               
5                AB14              NJ                 



Output1: 422 RECL

Code:


RecId          Policy #         Text                   Value
(Pos 1-19)  (Pos 20 - 30)   (Pos 31 -34)    (Pos 35 - 44)
---------------------------------------------------------------
1                AB12              NH                SUBBU
2                AB12              NH                SUBBU
3                AB13              MS                KRIS
4                AB13              MS                KRIS
5                AB14              NJ                 MAC

Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Mar 05, 2010 4:46 am    Post subject:
Reply with quote

Here's a DFSORT JOINKEYS job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB)
//IN2 DD DSN=...  input file2 (FB)
//SORTOUT DD DSN=...  output file (FB/422)
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(20,11,A)
  JOINKEYS F2=IN2,FIELDS=(20,11,A)
  REFORMAT FIELDS=(F2:1,34,F1:35,10)
  OPTION COPY
  OUTREC OVERLAY=(422:X)
/*
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us