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
Warnings : 1

Active User

Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Wed Feb 17, 2016 11:40 pm
Reply with quote


I am trying to achieve the following:

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:
//IN1 DD *                                                         
//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)

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

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

Active User

Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

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

Try this


//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


Similar Topics
Topic Forum Replies
No new posts Compare the file record count percent... DFSORT/ICETOOL 4
No new posts compare two file to find position/dat... SYNCSORT 2
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Matching and non matching records usi... DFSORT/ICETOOL 11
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
Search our Forums:

Back to Top