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

copy records from 2 files with different lrecl using 1 step


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

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Wed Aug 04, 2010 6:32 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Aug 04, 2010 6:58 pm
Reply with quote

Just use the one ICETOOL step. Or am I missing something here?
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Wed Aug 04, 2010 7:03 pm
Reply with quote

Forgot to include that - there is no ICETOOL in our shop icon_sad.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8798
Location: Welsh Wales

PostPosted: Wed Aug 04, 2010 7:05 pm
Reply with quote

Are you using DFSORT or SYNCSORT ?
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Aug 04, 2010 7:13 pm
Reply with quote

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
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Wed Aug 04, 2010 9:17 pm
Reply with quote

Also, are both input files Fixed Length, both Variable length, or a mix - and if a mix, which is which?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Aug 04, 2010 10:04 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Aug 05, 2010 4:29 am
Reply with quote

Hi,

do the fields in each file match, like do they line up, same length ?


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

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Aug 05, 2010 2:34 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8798
Location: Welsh Wales

PostPosted: Thu Aug 05, 2010 2:37 pm
Reply with quote

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
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Aug 05, 2010 2:50 pm
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Aug 05, 2010 5:15 pm
Reply with quote

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
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Aug 05, 2010 5:22 pm
Reply with quote

Oky i got the point now... Thanks for clarification icon_smile.gif
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: Thu Aug 05, 2010 10:24 pm
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Joining files with intermittent heade... SYNCSORT 1
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts INPFIL FILES, FNAMES examples SYNCSORT 7
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sort SMF records? SYNCSORT 6
Search our Forums:


Back to Top