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

Selection from 2 files


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

New User


Joined: 27 Sep 2007
Posts: 5
Location: rotterdam

PostPosted: Fri Oct 24, 2008 6:55 pm
Reply with quote

Hello,

I need a sort JCl for the following:

In FileB are the accountnumbers which will be selected from FileA.

FileA: reclen 354 reclen. Accountnumbers are on positions 23 thru 29 in packed decimal format.
FileB: reclen 15 and Accountnumbers are on first 11 characters in ZD.

In FileA could it be duplicate accountnumbers, but not in B.

FileA:
Code:
<...><accountnbr1><data1>
<...><accountnbr2><data2>
<...><accountnbr3><data3>
<...><accountnbr3><data3a>
<...><accountnbr4><data4>
....

FileB:
Code:
<accountnbr1><...>
<accountnbr3><...>


Output should be:

Code:
<...><accountnbr1><data1>
<...><accountnbr3><data3>
<...><accountnbr3><data3a>


Can i use SYMNAMES for this?

Thx.

Edited: Please use BBcode when You post some code, that's rather readable...Anuj
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 24, 2008 9:29 pm
Reply with quote

ERHAN,

The following DFSORT/ICETOOL JCL will give you the desired results


Code:

//STEP0100 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=your 15 byte fileb,
//            DISP=SHR                                               
//IN2      DD DSN=YOUR 354 BYTE FILEB,
//            DISP=SHR               
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)         
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
  COPY FROM(IN1) USING(CTL1)                                         
  COPY FROM(IN2) USING(CTL2)                                         
  SPLICE FROM(T1) TO(OUT) ON(23,7,PD) WITHALL WITH(01,354) USING(CTL3)
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=T1,                                                   
  BUILD=(23:1,11,ZD,PD,LENGTH=7,355:1,11,ZD,PD,LENGTH=7)             
//CTL2CNTL DD *                                                       
  OUTFIL FNAMES=T1,OVERLAY=(355:7X)                                   
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUT,BUILD=(01,354),                                   
  INCLUDE=(23,7,PD,EQ,355,7,PD)                       
/*
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top