Why we use "KEEP" in our jcl



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Why we use "KEEP" in our jcl

Postby Deepak kumar25 » Sat Oct 20, 2012 4:44 pm

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
Deepak kumar25
 
Posts: 34
Joined: Mon Jan 10, 2011 10:51 am
Has thanked: 0 time
Been thanked: 0 time

Re: why we use keep in our jcl

Postby Robert Sample » Sat Oct 20, 2012 5:59 pm

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: why we use keep in our jcl

Postby steve-myers » Sat Oct 20, 2012 8:47 pm

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: why we use keep in our jcl

Postby dick scherrer » Sun Oct 21, 2012 9:19 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: why we use keep in our jcl

Postby halfteck » Mon Oct 22, 2012 10:29 am

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
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: why we use keep in our jcl

Postby steve-myers » Mon Oct 22, 2012 11:25 am

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
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: why we use keep in our jcl

Postby dick scherrer » Mon Oct 22, 2012 11:31 pm

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: why we use keep in our jcl

Postby c62ap90 » Fri Nov 02, 2012 4:51 am

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.
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Re: why we use keep in our jcl

Postby dick scherrer » Fri Nov 02, 2012 7:04 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: why we use keep in our jcl

Postby c62ap90 » Fri Nov 02, 2012 7:56 pm

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
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Next

Return to JCL