View previous topic :: View next topic
|
Author |
Message |
Bang_1
New User
Joined: 08 May 2009 Posts: 39 Location: Bangalore
|
|
|
|
Can I copy records from 2 files with different record lengths (one is of 478 and other one is of 3300) into a output file (with lrecl of 3300) using a single DFSORT step?
Before posting this question, i referred most of the posts in DFSORT forum related to this. Most of them are referring to ICETOOL and there is one which tells it will be done in 2 steps using DFSORT. Do I have to resolve this using 2 steps??? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Just use the one ICETOOL step. Or am I missing something here? |
|
Back to top |
|
|
Bang_1
New User
Joined: 08 May 2009 Posts: 39 Location: Bangalore
|
|
|
|
Forgot to include that - there is no ICETOOL in our shop |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Are you using DFSORT or SYNCSORT ? |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
If you have DFSort, you should have ICETOOL. Seems like you are using SYNCSORT.
Please post SYSOUT for any of your test sort job.
Thanks, |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
Also, are both input files Fixed Length, both Variable length, or a mix - and if a mix, which is which? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Bang_1 wrote: |
Can I copy records from 2 files with different record lengths (one is of 478 and other one is of 3300) into a output file (with lrecl of 3300) using a single DFSORT step?
Do I have to resolve this using 2 steps??? |
I never get this fixation for 1 step vs multiple steps. *sigh* You ought to pick the most optimal solution, not count the number of steps. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
do the fields in each file match, like do they line up, same length ?
Gerry |
|
Back to top |
|
|
Bang_1
New User
Joined: 08 May 2009 Posts: 39 Location: Bangalore
|
|
|
|
Aplogies for the late reply as was tesing with ICETOOL after reading sqlcode1 reply.
Since iam using first time ICETOOL, used manual on this forum to code little bit.
Here is the code snapshot -
//STEP#001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=INPUT.FILE1 /*LRECL OF 3300 & has 1 record
//IN2 DD DISP=SHR,DSN=INPUT.FILE2 /*LRECL OF 478 & has 21 records
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DISP=OLD,DSN=OUT.FILE /*LRECL OF 3300
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1)
COPY FROM(IN2) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(1,478,ZD) WITH(479,3300)
/*
//CTL1CNTL DD *
SORT FIELDS=COPY
INREC OVERLAY=(3300:X)
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,3300)
/*
after execution, T1 is received all 22 recrods, but OUT has only 3 records in it. i dont have clear understanding on ON & WITH clause of SPLICE. Can anyone guide me here? I should get all records from T1 to OUT. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why are you doing the splice. T1, from your original post, is the output that you require.
Going back to the post by Skolusu, what do you think is the benefit from only using one step. |
|
Back to top |
|
|
Bang_1
New User
Joined: 08 May 2009 Posts: 39 Location: Bangalore
|
|
|
|
To answer first question,
here i used splice to concatinate records with different lrecls to a single file. That is the only option till now i found using icetool manual.
and for second question,
if there is a solution to conctinate these kind of files with one step, as a programmer i prefer to that in 1 step. |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Bang_1
Quote: |
here i used splice to concatinate records with different lrecls to a single file. That is the only option till now i found using icetool manual. |
If your only intention is to copy records from the different files of different LRECL(concatenate), then T1 in your JCL should give you all the records. You don't need splice. Also CTL2 is unused here.
Quote: |
after execution, T1 is received all 22 recrods, but OUT has only 3 records in it. i dont have clear understanding on ON & WITH clause of SPLICE. Can anyone guide me here? I should get all records from T1 to OUT. |
This is probably a result of SPLICE which you don't need.
Quote: |
if there is a solution to conctinate these kind of files with one step, as a programmer i prefer to that in 1 step |
You should be concerned with using most efficient solution not just the solution using single step.
Thanks. |
|
Back to top |
|
|
Bang_1
New User
Joined: 08 May 2009 Posts: 39 Location: Bangalore
|
|
|
|
Oky i got the point now... Thanks for clarification |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
For completeness, here's the correct DFSORT/ICETOOL job for what you want to do:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=INPUT.FILE1 /*LRECL OF 3300 & has 1 record
//IN2 DD DISP=SHR,DSN=INPUT.FILE2 /*LRECL OF 478 & has 21 records
//OUT DD DSN=NEW.FILE,DISP=(MOD,DELETE),...
//TOOLIN DD *
COPY FROM(IN1) TO(OUT)
COPY FROM(IN2) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
INREC OVERLAY=(3300:X)
/*
|
|
|
Back to top |
|
|
|