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

Merge 2 Input files with LRECL=45, FB into LRECL=133, FBA,


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

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Sun Dec 07, 2008 12:48 pm
Reply with quote

I need to merge two input files with LRECL=45 RECFM=FB into an output dataset with LRECL=133, RECFM=FBA

Input 1 is like
PDSCU.CFXCM.A1
PDSCU.CFXCM.A2
PDSCU.CFXCM.A3

Input 2 is like
PDSCU.CFXCM.B1
PDSCU.CFXCM.B2
PDSCU.CFXCM.B3

In output i want
START OF REPORT
PDSCU.CFXCM.A1 PDSCU.CFXCM.B1
PDSCU.CFXCM.A2 PDSCU.CFXCM.B2
PDSCU.CFXCM.A3 PDSCU.CFXCM.B3
END OF REPORT

I need to do this by sort.

[/Search]
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Dec 07, 2008 12:55 pm
Reply with quote

vikramyadav,

Do you have equal number of records in both the input files? If not, please explain how it should be handled in output.
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Sun Dec 07, 2008 1:49 pm
Reply with quote

if we have equal number of records on both the input files then fine, else the data is truncated. i.e the records are only copied till the time the records in both the files are equal and the rest of the records are discarded.
if input file 1 has 5 records
if input file 2 have 8 records

then in output file the last 3 extra records of input file2 are not present.
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: Sun Dec 07, 2008 5:37 pm
Reply with quote

Hello,

Post the "unbalanced" input and what you want as output when this happens.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Dec 08, 2008 6:12 am
Reply with quote

vikramyadav,

Here's a DFSORT/ICETOOL job that will do what I think you asked for based on your description. If it doesn't give you what you want, then show an example of your input records and exactly what you do want for output.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/45)
//IN2 DD DSN=...  input file2 (FB/45)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD RECFM=FBA,DSN=...  output file (FBA/133)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(134,8,ZD) WITH(47,45) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(2:1,45,134:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC BUILD=(47:1,45,134:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,
    HEADER1=(15:'START OF REPORT'),
    BUILD=(1,133),
    TRAILER1=(15:'END OF REPORT')
/*
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Mon Dec 08, 2008 9:54 am
Reply with quote

Hi,

we are only allowed to use PGM=SORT in our program. So we cant use ICETOOL.

Input file1

Code:

=COLS> ----+----1----+----2
****** ********************
000001 PDSCU.CFXMA.A.FILE1
000002 PDSCU.CFX.B.FILE1   
000003 PDSCU.CFXMA.C.FILE1
000004 PDSCU.CFXMA.D.FILE1
000005 PDSCU.CFX.E.FILE1   


Input file2

Code:

=COLS> ----+----1----+--
****** *****************
000001 PDSCU.CFX.F.FILE2
000002 PDSCU.CFX.G.FILE2
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Mon Dec 08, 2008 10:32 am
Reply with quote

Output

Code:

=COLS> ----+----1----+----2----+----3----+-----4----+----5----+----6----+----7----+-
****** ***************************** Top of Data************************************
000001 0                                       MONTHEND TAPE ZAPS
000002            PROD FILE NAME                                  BACKUP FILE NAME
000003 0          PDSCU.CFXMA.A.FILE1                             PDSCU.CFX.F.FILE2
000004 0          PDSCU.CFX.B.FILE1                               PDSCU.CFX.G.FILE2
000005 0                                           E N D    O F    R E P O R T


Please see previous post to see what the i/p & o/p files are like
Special consideration here is that
1. 0 is getting padded in the first column.
2. we have the header 'MONTHEND TAPE ZAPS'
3. we have the trailer 'E N D O F R E P O R T'
4. when the input1 records are copied to output then the have a heading of PROD FILE NAME.
5. 4. when the input1 records are copied to output then the have a heading of BACKUP FILE NAME.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Dec 08, 2008 10:49 pm
Reply with quote

Quote:
we are only allowed to use PGM=SORT in our program. So we cant use ICETOOL.


Given this ridiculous restriction, I can't help you.

ICETOOL has been a fully documented, fully supported part of DFSORT since 1991! There's no valid reason not to use it here since the SPLICE function is needed to do what you asked for.
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 WER247A SORTOUT HAS INCOMPATIBLE LRECL SYNCSORT 7
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top