Page 1 of 1

difference between KEEP and PASS while using in JCL

Posted: Thu Jan 16, 2025 2:23 pm
by Nikhil Aryan
Hi,

What is the difference between KEEP and PASS while using in JCL for dispositional parameters. Do they behave same for temp dataset but different for regular dataset?

Re: difference between KEEP and PASS while using in JCL

Posted: Thu Jan 23, 2025 7:48 pm
by Anuj Dhawan
The KEEP and PASS parameters in JCL are used in the disposition (DISP) of a dataset. While they may appear similar at first glance, they have distinct behaviors, particularly when dealing with temporary datasets versus permanent datasets.

1. KEEP Disposition
  • Purpose: Retains the dataset after the job or step ends.
  • For Temporary Datasets (&&temp):
    • KEEP is not valid for temporary datasets. If specified, the job will result in an error because temporary datasets are automatically deleted at the end of the job unless passed explicitly.
  • For Permanent Datasets:
    • When KEEP is specified, the dataset is retained, but no catalog entry is created or updated unless explicitly defined elsewhere (e.g., VOL=SER parameter is provided).
    • If no VOL=SER or catalog information is provided, the dataset is not retrievable unless the exact volume serial number is known.
2. PASS Disposition
  • Purpose: Passes the dataset to the next job step.
  • For Temporary Datasets (&&temp):
    • PASS is used to pass the temporary dataset to a subsequent step in the same job.
    • The dataset is automatically deleted when the job ends, even if passed between steps.
  • For Permanent Datasets:
    • PASS is not typically used for permanent datasets because they are meant to be retained or cataloged, not passed temporarily between steps.

Re: difference between KEEP and PASS while using in JCL

Posted: Wed Jan 29, 2025 10:13 am
by Nikhil Aryan
Thank you for the explanation this really helps. I had been confusing it all over.