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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Merge 2 Input files with LRECL=45, FB into LRECL=133, FBA,
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: 2284
Location: @my desk

PostPosted: Sun Dec 07, 2008 12:55 pm    Post subject:
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    Post subject: Hi, arcvns
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

Site Director


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

PostPosted: Sun Dec 07, 2008 5:37 pm    Post subject:
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 Moderator


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

PostPosted: Mon Dec 08, 2008 6:12 am    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Dec 08, 2008 10:49 pm    Post subject:
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    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 How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Need input in Scheduling Benchwarmer CA Products 5 Tue Jun 06, 2017 1:44 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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