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

merge records from 2 ps files with diff lrecl


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

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Wed Mar 19, 2014 1:00 pm
Reply with quote

Hi All,

I am using the below to merge two ps file records into one ps file using-

Code:
//S05TL   EXEC PGM=ICETOOL
//TOOLMSG  DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN1      DD  DSN=KK1.OUTPUT.O2,DISP=SHR
//IN2      DD  DSN=KK2.OUTPUT.O2,DISP=SHR
//OUT      DD  DSN=KK3.PROD.OUTPUT,DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(50,50),RLSE),LRECL=100,RECFM=FB
//TOOLIN   DD  *
  COPY FROM(IN1) TO(OUT) USING(CTL1)
  COPY FROM(IN2) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD  *
  OPTION COPY
/*

IN1 : LRECl= 63,BLKSIZE=27972
IN2 : LRECl=100, BLKSIZE=27900


Please assist.

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 19, 2014 6:35 pm
Reply with quote

Hello,

Suggest you look at some of the JOINKEYS examples here in the forum.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Thu Mar 20, 2014 12:27 am
Reply with quote

You might be looking for this, also as Dick suggested you can look for JOINKEYS as well.


Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/63)
//IN2 DD DSN=...  input file2 (VB/100)
//OUT DD DISP=MOD,DSN=...  output file (FB/100)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT)
COPY FROM(IN2) USING(CTL1)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,VTOF,OUTREC=(5,95,100:X)
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Mar 21, 2014 10:22 pm
Reply with quote

Rohit Umarjikar wrote:


Code:

//IN2 DD DSN=...  input file2 (VB/100)
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,VTOF,OUTREC=(5,95,100:X)


Rohit,

2 minor points.

1. I am not sure as to why you think OP has a VB dataset.
2. Since you overrode the LRECL to 100 in the JCL the contents from the first copy for the dataset with LRECL of 63 will have binary zeroes padded from position 64 thru 100.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Sat Mar 22, 2014 12:30 am
Reply with quote

Your are Right , I misunderstood the question.

Due to region down, I can not able to test but I think below should work for the TS, please correct if I missed something.



Code:
//STEP0100 EXEC PGM=ICETOOL             
//TOOLMSG  DD SYSOUT=*                 
//DFSMSG   DD SYSOUT=*                 
//IN1      DD  DSN=KK1.OUTPUT.O2,DISP=SHR
//IN2      DD  DSN=KK2.OUTPUT.O2,DISP=SHR
//OUT      DD  DSN=KK3.PROD.OUTPUT,DISP=(MOD,CATLG,DELETE),
//             SPACE=(CYL,(50,50),RLSE),LRECL=100,RECFM=FB 
//TOOLIN   DD *                         
  COPY FROM(IN1) TO(OUT)   USING(CTL1)             
  COPY FROM(IN2) TO(OUT)
//CTL1CNTL DD *                         
  INREC OVERLAY=(100:X)                 
//*
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Mar 22, 2014 1:19 am
Reply with quote

Rohit Umarjikar wrote:
Your are Right , I misunderstood the question.

Due to region down, I can not able to test but I think below should work for the TS, please correct if I missed something.



Code:
LRECL=100,RECFM=FB 
//CTL1CNTL DD *                         
  INREC OVERLAY=(100:X)                 
//*


You really don't need the DCB parameters in JCL as DFSORT is quite capable of calculating based on the input or INREC/OUTREC/OUTFIL control cards. So remove them.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Sat Mar 22, 2014 2:23 am
Reply with quote

Code:
//STEP0100 EXEC PGM=ICETOOL             
//TOOLMSG  DD SYSOUT=*                 
//DFSMSG   DD SYSOUT=*                 
//IN1      DD  DSN=KK1.OUTPUT.O2,DISP=SHR
//IN2      DD  DSN=KK2.OUTPUT.O2,DISP=SHR
//OUT      DD  DSN=KK3.PROD.OUTPUT,DISP=(MOD,CATLG,DELETE),
//             SPACE=(CYL,(50,50),RLSE)
//TOOLIN   DD *                         
  COPY FROM(IN1) TO(OUT)   USING(CTL1)             
  COPY FROM(IN2) TO(OUT)
//CTL1CNTL DD *                         
  INREC OVERLAY=(100:X)                 
//*
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 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 Pulling a fixed number of records fro... DB2 2
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top