Page 1 of 1

Writing to the same generation file from one ICETOOL

PostPosted: Wed Jul 06, 2011 7:34 pm
by olivermf
Hello again,

I have a question regarding the use of ICETOOL if I want to write to a generation dataset the first time with DISP=SHR and the second time with DISP=MOD.

If I use a "normal" PO-File this works without any problems:

//IEFNULL-Step to create new OUT.TEST5210(+1)

//ICETOOL EXEC PGM=ICETOOL                         
//TOOLMSG   DD SYSOUT=A                           
//DFSMSG    DD SYSOUT=A                           
//IN1       DD DSN=FILE1.DATASET(+0),DISP=SHR
//IN2       DD DSN=FILE2.DATASET(+0),DISP=SHR
//OUT1      DD DSN=OUT.TEST5210(+1),DISP=SHR         
//OUT2      DD DSN=OUT.TEST5210(+1),DISP=MOD         
//TOOLIN    DD *                                   
 COPY FROM(IN1) TO(OUT1) USING(CTL1)               
 COPY FROM(IN2) TO(OUT2) USING(CTL2)               
//CTL1CNTL  DD *                                   
 SORT FIELDS=COPY                                 
//CTL2CNTL  DD *                                   
 INCLUDE COND=(1728,7,CH,NE,C'       ')           
 SORT FIELDS=COPY                                 


When I try this the job hangs several minutes until I manually stop it...
What do I have to do?

Thank you very much!

Regards

Oliver

Re: Writing to the same generation file from one ICETOOL

PostPosted: Wed Jul 06, 2011 7:42 pm
by Robert Sample
When I try this the job hangs several minutes until I manually stop it...
What do I have to do?
Do not use a GDG -- quite simple, really.

Find the JCL Reference manual and read up on the enqueue that is done on the GDG base name whenever you use a relative generation reference.

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 10:23 am
by olivermf
Robert Sample wrote:Do not use a GDG -- quite simple, really.


Hello Robert,

thank you for your fast reply.

Well... not to use the GDG is not an option.
I need to use it. The question is just how...

How would be this solution:

First I write into a new created temporary file &&temp and then in step 2 in &&temp with DISP=MOD.
In a third step I simply copy from &&temp in a new created generation of my GDG-file.

Is there a better solution?

Regards

Oliver

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 11:04 am
by MrSpock
Why can't you have just one DD statement, pointing to the new generation of the GDG, with a DISP=MOD disposition?

//ICETOOL EXEC PGM=ICETOOL                         
//TOOLMSG   DD SYSOUT=*                           
//DFSMSG    DD SYSOUT=*                     
//IN1       DD DSN=FILE1.DATASET(0),DISP=SHR
//IN2       DD DSN=FILE2.DATASET(0),DISP=SHR
//OUT       DD DSN=OUT.TEST5210(+1),DISP=(MOD,CATLG,DELETE),UNIT=....,
//TOOLIN    DD *                                   
COPY FROM(IN1) TO(OUT)   
COPY FROM(IN2) TO(OUT) USING(CTL2)     
/*                                     
//CTL2CNTL  DD *                                   
  INCLUDE COND=(1728,7,CH,NE,C' ')
/*                             

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 11:10 am
by olivermf
Well... honestly I thought this would not be possible...
Is Icetool creating a new generation of the file, if I do not use DISP=(NEW,...)?

I'll try that! :-)

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 2:25 pm
by olivermf
Thank you MrSpock!
This happens to be just the solution I was looking for!

Regards,

Oliver

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 10:43 pm
by dick scherrer
Hello,

You need to understand that neither this question nor the solution has anything to do with ICETOOL (or any other utility). . .

If this is not completely clear (it is NOT sufficient that it merely "works"), you need to review just how JCL and Generations work. . .

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 10:54 pm
by olivermf
Hello Dick,

until today I had the problem that I didn't have GDG-files - simply because I did not know how to create them.
But now I can use my own GDG files and learn more about them.

I will read more about it in the JCL and MVS documentations and hope to understand better.

I'm not sure, but I think I once tried to create a new file in a JCL with DISP=(MOD,CATLG,DELETE) (not GDG, simple file) and this did not work.
So I thought a new generation of a GDG could only be created with (NEW,CATLG,DELETE), too.

I am very new to mainframes, so I am always happy about every possible hint.

Regards,

Oliver

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 11:04 pm
by dick scherrer
Hi Oliver,

I am very new to mainframes, so I am always happy about every possible hint.
When you have questions, someone is usually here (or soon will be :) ).

Sometimes, one may get a little "beat up", but don't let that discourage you ;)

d

Re: Writing to the same generation file from one ICETOOL

PostPosted: Thu Jul 07, 2011 11:10 pm
by olivermf
Hi Dick,

thank you, it doesn't discourage me.

I'm learning more from day to day ;-)

Regards,

Oliver