Page 1 of 2

Why we use "KEEP" in our jcl

PostPosted: Sat Oct 20, 2012 4:44 pm
by Deepak kumar25
helo every one can anyone tell me what is the main use of keep in jcl.
As we know if we use disp=(new,keep,delete)

after execution of job the data set is not cataloged and we can access this data set using volume & serial no.
my question is that if that data set is not cataloged after execution of job and we can not access it using 3.4 then why we need that type of data set.

my second question is that if a data set is uncatlg . Is there any benifit to mainframe to uncatlg a data set.


i am confused please clear me.




Deepak kumar

Re: why we use keep in our jcl

PostPosted: Sat Oct 20, 2012 5:59 pm
by Robert Sample
Part of the reason for KEEP is history -- IBM retains the option for compatibility with previous software. If IBM removed KEEP, then old JCL may not work and that is not something they want to cause.

Another part of the reason is that system programmers, for example, use KEEP at times. When certain system data sets need to be rebuilt with more space (many of these data sets are defined with no secondary because if they go into extents it will cause problems for the system), the process is to allocate a new one with the same name on a different system volume. The new one cannot be cataloged because the old one is still cataloged. Once the new one is validated, the system is updated to remove the pointer to the old one, it is deleted from the catalog, then the new one is cataloged and the pointer to the system date set restored.

These days, however, an application programmer should not use KEEP since their data sets should ALWAYS be in the catalog.

Re: why we use keep in our jcl

PostPosted: Sat Oct 20, 2012 8:47 pm
by steve-myers
In my opinion, Mr. Sample is not quite complete, for these reasons.
  1. DISP=(OLD,KEEP), or DISP=(SHR,KEEP) is perfectly OK for an existing data set. KEEP is usually the default when using DISP=OLD or DISP=SHR.
  2. In the early days of OS/360, the use of the catalog was relatively uncommon; most data sets, especially tape data sets, were not cataloged, so DISP=(NEW,KEEP), or DISP=(,KEEP) was required.
Now I said KEEP is usually the default when using DISP=SHR, or DISP=OLD. This is not always true. When JCL specifies DISP=(NEW,PASS) in one step, and a subsequent step specifies DISP=OLD to retrieve the data set, the default becomes DELETE, because that's the default when using DISP=NEW.

Re: why we use keep in our jcl

PostPosted: Sun Oct 21, 2012 9:19 am
by dick scherrer
Hello,

You should not concern yourself about Ever using (new,keep,whatever) in your JCL. Well managed systems will not allow this (neither for dasd nor removable media) for application processes. Everything that is to be retained should be cataloged. There are situations when certain systems tasks are supported using this technique, but Not for application developers/processing.

Re: why we use keep in our jcl

PostPosted: Mon Oct 22, 2012 10:29 am
by halfteck
1 situation where you might use KEEP is DISP=(OLD,DELETE,KEEP), the rules for DISP are that if you dont code the 3rd sub parameter, the default used is the second subparameter. Hence coding DISP=(OLD,DELETE) means that on an ABEND your file is deleted, which may or may not be what you wanted

Re: why we use keep in our jcl

PostPosted: Mon Oct 22, 2012 11:25 am
by steve-myers
Halfteck is 100% correct, though it's rare. In my work, the only time I use DISP=(NEW,DELETE,CATLG) is when I want a dump data set to be retained only if it seems there is something in the data set: for example -
//A       EXEC PGM=program-that-may-ABEND
//SYSMDUMP DD  DISP=(NEW,DELETE,CATLG),UNIT=SYSDA,
//             SPACE=(CYL,(50,20)),
//             DSN=&SYSUID..DUMP.FOR.IPCS

Re: why we use keep in our jcl

PostPosted: Mon Oct 22, 2012 11:31 pm
by dick scherrer
Hello,

1 situation where you might use KEEP is DISP=(OLD,DELETE,KEEP),
Which has Nothing to do with (,new,keep) which was the original question . . .

(new,delete,catlg) is also quite useful for being able to look at transient/work files that would be passed or deleted (while testing).

Re: why we use keep in our jcl

PostPosted: Fri Nov 02, 2012 4:51 am
by c62ap90
The simple answer for using KEEP is the application does not want a dataset Cataloged/CATLG. The reasons for KEEP are endless. Saying never use KEEP is incorrect in my opinion. Learn what KEEP does to extend your knowledge. Saying always use NEW,CATLG,DELETE for a new dataset is incorrect. Learn what your application needs/does and code accordingly.

Re: why we use keep in our jcl

PostPosted: Fri Nov 02, 2012 7:04 am
by dick scherrer
Hello,

The reasons for KEEP are endless.
There are usually endless bad reasons to do something. There are Very few acceptable reasons to specify (new,keep,whatever) and i can think of none that would be acceptable for regularly run Production Applicaton jobs.

The simple answer for using KEEP is the application does not want a dataset Cataloged/CATLG.
The decision in well-managed organizations has been removed from "what the application wants". Well-managed systems have formal Storage Management support the determines what is and is not acceptable specification of the storage resources.

Re: why we use keep in our jcl

PostPosted: Fri Nov 02, 2012 7:56 pm
by c62ap90
dick scherrer wrote:Hello,

The reasons for KEEP are endless.
There are usually endless bad reasons to do something. There are Very few acceptable reasons to specify (new,keep,whatever) and i can think of none that would be acceptable for regularly run Production Applicaton jobs.

The simple answer for using KEEP is the application does not want a dataset Cataloged/CATLG.
The decision in well-managed organizations has been removed from "what the application wants". Well-managed systems have formal Storage Management support the determines what is and is not acceptable specification of the storage resources.


Dick, since you cannot think of any regularly run Production Application jobs that would use NEW,KEEP,DELETE let me give you just 1 example from my experience.

When I worked for IBM I was contacted out to the Navy in San Diego. Some of the regularly run Production Application job datasets HAD to be NEW,KEEP,DELETE since they did not want anyone accidently keying the dataset name in, for example, 3.4 and pocking around these sensitive datasets. There was security on the datasets too but the good decision to not Catalogued/CATLG was an extra security measure.

In my opinion IBM and the Navy are very well-managed organizations. :D