Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
ICETOOL: can a temporary dataset be reused?

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

New User


Joined: 15 Nov 2007
Posts: 39
Location: New York

PostPosted: Wed Jul 07, 2010 10:31 pm    Post subject: ICETOOL: can a temporary dataset be reused?
Reply with quote

Frank,

Please consider the following JCL snippet:

Code:
//  EXEC PGM=MYAPP        /* call ICETOOL via the TOOLIN interface
//* temporary datasets for use by ICETOOL operators:
//T1 DD DSN=&&T1,UNIT=DISK,DISP=(,PASS),SPACE=(CYL,(500,100)),
//         STORCLAS=MYTEMP,DCB=(BLKSIZE=0),VOL=(,,,10)
//T2 DD DSN=&&T2,UNIT=DISK,DISP=(,PASS),SPACE=(CYL,(500,100)),
//         STORCLAS=MYTEMP,DCB=(BLKSIZE=0),VOL=(,,,10)

Here's a TOOLIN snippet:

Code:
COPY FROM(INFILEA) TO(T1) USING(CPA1)
COPY FROM(T1) TO(OUTFILEA) USING(CPA2)
COPY FROM(INFILEB) TO(T2) USING(CPB1)
COPY FROM(T2) TO(OUTFILEB) USING(CPB2)

(Our actual ICETOOL application is much more complicated; I've dramatically simplified the example to illustrate my question.)

We are executing an assembler application that invokes ICETOOL via the TOOLIN interface. The temporary datasets T1 and T2 are both allocated from the same STORCLAS. Algorithmically, T1 and T2 have nothing to do with each other; i.e., after ICETOOL is finished with T1, and starts using T2, it doesn't need the data in T1. However (unless I'm missing something) I have to allocate both T1 and T2. What I'm wondering is if I can somehow get away with using only one temporary dataset, or if I can somehow inform DFSORT that I'm "finished" with T1, so that it can reuse the same disk space. Please note that the LRECL for T1 and T2 may be different.

If I were writing this entire application in assembler, and not invoking ICETOOL at all, I would dispense with the DD statements entirely. I would dynamically allocate T1, create OUTFILEA, then dynamically unallocate T1. Then I would do the same thing for OUTFILEB, again using T1 as my temporary dataset. I wouldn't need T2 at all. I just can't figure out how to do that given the TOOLIN above, or if it's even possible.

I hope my question is clear.

Thanks so much,

David
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2445
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 07, 2010 10:47 pm    Post subject:
Reply with quote

Hello,

im not Frank if thats ok with you.
But why cant you use only T1 as an intermediary ?
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: Wed Jul 07, 2010 10:55 pm    Post subject:
Reply with quote

Quote:
Please note that the LRECL for T1 and T2 may be different.


I think this is a JCL question, not a DFSORT question. I suspect that once you use T1 with a specific LRECL, that LRECL is still in the DSCB when the T1 data set is used again so that original LRECL is still used.

I tried an experiment where I just used the same T1 with DISP=(,PASS). The first input file had LRECL=40 and the second input file had LRECL=60. When I copied the LRECL=40 data set to T1, T1 was given LRECL=40 and had just the File1 records. When I copied the LRECL=60 data set to T1, T1 just had the File2 records, but it still had LRECL=40 instead of LRECL=60. I don't know how you could 'cancel out' the first LRECL given to T1 so a different LRECL could be given to T1 the next time. But I'm not a JCL expert. Maybe somebody else knows a way to do that.
Back to top
View user's profile Send private message
David Eisenberg

New User


Joined: 15 Nov 2007
Posts: 39
Location: New York

PostPosted: Thu Jul 08, 2010 12:44 am    Post subject:
Reply with quote

Frank Yaeger wrote:
I think this is a JCL question, not a DFSORT question. I suspect that once you use T1 with a specific LRECL, that LRECL is still in the DSCB when the T1 data set is used again so that original LRECL is still used.


Frank,

I think you're right about the DSCB, but I don't think that a JCL solution can exist. I can't imagine what I could put into the JCL that would effectively cause a dynamic modification of the LRECL on a subsequent OPEN.

I recreated your test using T1 only, and I got the same results as you. I then tried this:

Code:
 OPTION NOSOLRF               
 RECORD LENGTH=(60,60,60,60,60)


but nothing changed. I also took out the OPTION override and that didn't work either. Nothing changes the original LRECL of 40.

At what point does DFSORT do the OPEN of an output dataset? If I write an E11 exit and programmatically modify the LRECL in the DSCB for T1, might that be an early enough intervention such that it would work? (You might reasonably tell me to just try it.)

David
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 Jul 08, 2010 1:02 am    Post subject:
Reply with quote

If the data set already exists and has an LRECL, DFSORT will use that LRECL. I don't see how an E11 exit could change that or how knowing the point at which DFSORT does the OPEN would help.

For the first COPY, DFSORT creates the T1 output data set with the calculated LRECL. For every subsequent use of T1, DFSORT gets and uses that LRECL. The only way to override it would be to specify a different LRECL for T1, but obviously you can't do that if you're trying to use T1 for different LRECLs. DFSORT control statements will not override that LRECL.

As I said, I'm not a JCL expert, but I don't see a way to do what you want due to the way data set attributes work.
Back to top
View user's profile Send private message
David Eisenberg

New User


Joined: 15 Nov 2007
Posts: 39
Location: New York

PostPosted: Thu Jul 08, 2010 6:47 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
For the first COPY, DFSORT creates the T1 output data set with the calculated LRECL. For every subsequent use of T1, DFSORT gets and uses that LRECL.


Okay, got it. I assume that by "every subsequent use" you mean every subsequent use during that invocation of ICETOOL, correct?

My application program calls ICETOOL programmatically via the TOOLIN interface. Suppose I were to change my application to call ICETOOL twice (with different TOOLIN control cards each time, obviously). Suppose further that in between those two ICETOOL calls, I dynamically unallocate and reallocate T1 with a different LRECL. DFSORT would surely use the new T1 LRECL the second time, correct?

David
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 Jul 08, 2010 10:18 pm    Post subject:
Reply with quote

Yes, ICETOOL only sees the data set that is allocated at the time it is invoked. So if you deallocate and reallocate T1 in between calls, ICETOOL would see that as a new T1.
Back to top
View user's profile Send private message
David Eisenberg

New User


Joined: 15 Nov 2007
Posts: 39
Location: New York

PostPosted: Thu Jul 08, 2010 10:38 pm    Post subject:
Reply with quote

Great, Frank; thanks.

David
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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts ICETOOL - RESIZE DYNAMICALLY kranthikumarb DFSORT/ICETOOL 0 Tue Nov 21, 2017 5:30 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us