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
 

 

File matching with PD key on different positions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 103
Location: India

PostPosted: Wed Feb 17, 2016 11:40 pm    Post subject: File matching with PD key on different positions
Reply with quote

Hi,

I am trying to achieve the following:

Requirement:
1) Account number(key) on FILE1 is ZD at position 5. Length is 15. LRECL is 19. FILE1 is just a lookup file.
2) Account number(key) on FILE2 is PD at position 550. Length is 15. LRECL is 634
3) Output i need is:
    A) FILE2 should be overlayed with 'AB' at position 582 for accounts present in FILE1. For accounts present in FILE2 but not in FILE1, the records are untouched in FILE2.


What i tried:
Code:
//STEP075  EXEC PGM=ICETOOL
//IN1 DD *                                                         
    371262133046000                                               
    123456789123456                                               
/*                                                                 
//IN2 DD DSN=...
//T1 DD DSN=..., DISP=(MOD,PASS)               
//OUT13 DD DSN= BOTH,                     
//OUT3 DD DSN=F2ONLY                   
//TOOLIN DD *                                                         
COPY FROM(IN1) TO(T1) USING(CTL1)                                     
COPY FROM(IN2) TO(T1) USING(CTL2)                                     
SPLICE FROM(T1) TO(OUT13) ON(550,15,PD) WITH(646,1) -                 
USING(CTL3) KEEPNODUPS                                                 
/*                                                                     
//CTL1CNTL DD *                                             
INREC OVERLAY=(550:5,15,645:C'11')                           
/*                                                           
//CTL2CNTL DD *                                             
INREC OVERLAY=(645:C'33')                                   
/*                                                           
//CTL3CNTL DD *                                             
OUTFIL FNAMES=OUT13,INCLUDE=(645,2,CH,EQ,C'13'),BUILD=(1,581,C'AB',584,50)
OUTFIL FNAMES=OUT3,INCLUDE=(645,2,CH,EQ,C'33'),BUILD=(1,634)
/*


Appreciate any help. Thanks!
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Feb 18, 2016 8:03 am    Post subject: Reply to: File matching with PD key on different positions
Reply with quote

Why not using JOINKEYS with JNFnCNTL ?

.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 114
Location: Hyderabad

PostPosted: Thu Feb 18, 2016 12:00 pm    Post subject:
Reply with quote

Try this

Code:

//SORTKK    EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                         
//FILE1    DD DISP=SHR,DSN=<file1 recl 19 FB>
//FILE2    DD DISP=SHR,DSN=<file2 recl 634 FB>
//SORTOUT  DD SYSOUT=*                                         
//MATCH    DD SYSOUT=*                                         
//JNF2CNTL DD *                                               
  INREC OVERLAY=(635:550,8,PD,TO=ZDF,LENGTH=15)               
//SYSIN    DD *                                               
  JOINKEYS F1=FILE1,FIELDS=(5,15,A)                           
  JOINKEYS F2=FILE2,FIELDS=(635,15,A)                         
  JOIN UNPAIRED,F2                                             
  REFORMAT FIELDS=(F2:1,634,?)                                 
  OPTION COPY                                                 
  INREC IFTHEN=(WHEN=(635,1,CH,EQ,C'B'),OVERLAY=(582:C'AB'))   
  OUTFIL FNAMES=FILE2,BUILD=(1,634)                           
/*                                                             
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 -> DFSORT/ICETOOL 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