View previous topic :: View next topic
|
Author |
Message |
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
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 |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
I wonder why the contents of those two files look familiar. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
|