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

File matching with PD key on different positions


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Wed Feb 17, 2016 11:40 pm
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: 446
Location: USA

PostPosted: Thu Feb 18, 2016 8:03 am
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: 115
Location: Hyderabad

PostPosted: Thu Feb 18, 2016 12:00 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top