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: 338
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 Formating the Input file sreekusr DFSORT/ICETOOL 3 Fri Feb 17, 2017 10:40 pm
No new posts Matching and unmatching records scdinesh DFSORT/ICETOOL 11 Tue Feb 07, 2017 12:41 am
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm


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