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 two files of different record length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Sun Aug 29, 2010 6:43 pm    Post subject: Merge two files of different record length
Reply with quote

I have two inputs

INPUT FILE1 --> RECLEN (60)
INPUT FILE2 --> RECLEN (40)


I want output file merging these two files.
Contents of Input File1 should come first then followed by Second file contents.

I have tried SORT but because of Different RECLEN, Its not getting worked out.

Can someone help
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 Aug 29, 2010 7:15 pm    Post subject:
Reply with quote

Hello,

You need to show some sample input from both files and the output you want from the sample input. You need to explain any "rules" that are to be used.

If this is really a merge, you need to show the "keys" to be used for the merge. How should duplicates in either/both files be handled?
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Sun Aug 29, 2010 7:45 pm    Post subject: Reply to: Merge two files of different record length
Reply with quote

Hi,

There is no rule I just want to append second file content after first file content.


There are no duplicates in both the files and no common key to join
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Sun Aug 29, 2010 8:10 pm    Post subject: Reply to: Merge two files of different record length
Reply with quote

I have used

IN1 File contents
Code:

JOBNAME,CPU TIME,ELAPSED TIME,START TIME,END TIME


IN2 File Contents
Code:

G1246SE9,  7.81, 31.16,00.07.47,00.38.57
G1246SEI,  7.97, 45.05,00.07.52,00.52.55


I have used code
Code:

//STEP1 EXEC  PGM=ICETOOL                                 
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG  DD SYSOUT=*                                     
//IN1      DD DSN=SS5661.STATS.PULL.TOOL.SRTHDR,DISP=SHR   
//IN2      DD DSN=ABCD.STATS.PULL.TOOL.SARSRT,DISP=SHR 
//OUT      DD DSN=ABCD.STATS.PULL.TOOL.SARSRT1,         
//            DISP=(MOD,CATLG,DELETE),UNIT=SYSDA,         
//            DCB=(LRECL=80,RECFM=FB)                     
//TOOLIN DD *                                             
COPY FROM(IN1) TO(OUT)                                     
COPY FROM(IN2) TO(OUT) USING(CTL1)                         
//CTL1CNTL DD *                                           
  INREC FIELDS=(1,80)                                     
/*                                 
                       

Its getting MAXCC = 16
And generating Output file as
[code]
JOBNAME,CPU TIME,ELAPSED TIME,START TIME,END TIME
[\code]

Can someone tell why its not adding second file contents
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 Aug 29, 2010 10:57 pm    Post subject:
Reply with quote

Hello,

The longer you wait to post what is needed, the longer it will take to get your process running. . .

Is there some reason that you did not post the diagnostic output including the message ids?

Without seeing the actual error(s), i can only guess that you have specified 80 for a record that is only 60. You need to copy the 60 and pad the remainder with 20 spaces.

If the process does run successfully, you will need to make sure the output file is deleted before running it again.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sun Aug 29, 2010 11:20 pm    Post subject:
Reply with quote

I wonder why the contents of those two files look familiar.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Mon Aug 30, 2010 1:09 am    Post subject: Reply to: Merge two files of different record length
Reply with quote

most probably because the TS does not have a clear idea of the requirements
and asks different questions for each aspect of the issue at hand
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: Mon Aug 30, 2010 2:35 am    Post subject:
Reply with quote

Hello,

One would hope that after more than 2 years, TS would have learned that if all of the requirement is explained on the initial post, the result happens almost immediately.

All this approach (bits and pieces spread across multiple topics) does is to add clutter to the forum and take much longer to reach/do what is needed. . .
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Aug 30, 2010 9:45 am    Post subject:
Reply with quote

Hi,

try this

Code:
//TOOLIN   DD *                                             
COPY FROM(IN1) TO(OUT) USING(CTL1)                           
COPY FROM(IN2) TO(OUT) USING(CTL2)                           
//CTL1CNTL DD *                                             
  OUTREC FIELDS=(1,60,80:X)                                 
/*                                                           
//CTL2CNTL DD *                                             
  OUTREC FIELDS=(1,40,80:X)                                 
/*                                                           


Gerry
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Aug 30, 2010 9:44 pm    Post subject:
Reply with quote

scorp_rahul23,

Is this request any way related to other request where you want to append a header? If so it can be done in the same job itself.

If this is different request, then the following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//FB60     DD DSN=Your input FB 60 byte file,DISP=SHR
//FB40     DD DSN=Your input FB 40 byte file,DISP=SHR       
//OUT      DD DSN=Your output FB 60 byte file,
//            DISP=(MOD,CATLG,DELETE),
//            UNIT=SYDA,
//            SPACE=(CYL,(X,Y),RLSE)   
//TOOLIN   DD *
  COPY FROM(FB60) TO(OUT)
  COPY FROM(FB40) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
  OUTREC OVERLAY=(60: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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm


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