Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
merge records from 2 ps files with diff lrecl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: merge records from 2 ps files with diff lrecl
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

Site Director


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

PostPosted: Wed Mar 19, 2014 6:35 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1896
Location: NY,USA

PostPosted: Thu Mar 20, 2014 12:27 am    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1896
Location: NY,USA

PostPosted: Sat Mar 22, 2014 12:30 am    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1896
Location: NY,USA

PostPosted: Sat Mar 22, 2014 2:23 am    Post subject:
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    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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us