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
 

 

copy records from 2 files with different lrecl using 1 step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: copy records from 2 files with different lrecl using 1 step
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

Moderator Team Head


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

PostPosted: Wed Aug 04, 2010 6:58 pm    Post subject: Reply to: copy records from 2 files with different lrecl usi
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    Post subject: Reply to: copy records from 2 files with different lrecl usi
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 04, 2010 7:05 pm    Post subject:
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: 578
Location: USA

PostPosted: Wed Aug 04, 2010 7:13 pm    Post subject:
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    Post subject:
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    Post subject: Re: copy records from 2 files with different lrecl using 1 s
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: 1703
Location: Australia

PostPosted: Thu Aug 05, 2010 4:29 am    Post subject:
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    Post subject: Reply to: copy records from 2 files with different lrecl usi
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: 8593
Location: Back in jolly old England

PostPosted: Thu Aug 05, 2010 2:37 pm    Post subject:
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    Post subject: Reply to: copy records from 2 files with different lrecl usi
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: 578
Location: USA

PostPosted: Thu Aug 05, 2010 5:15 pm    Post subject:
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    Post subject: Reply to: copy records from 2 files with different lrecl usi
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 Moderator


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

PostPosted: Thu Aug 05, 2010 10:24 pm    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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