What could be the disposition parameter that i would have to use in the jcl if i have a file that has to be created newly for every successful run of the program ,but at the same time it should retain the old data if my program abend in the middle and restarts. could you please provide me the code?

Showing Answers 1 - 5 of 5 Answers

karthik

  • Feb 3rd, 2006
 

Disp=(new,catlg,delete)

  Was this answer useful?  Yes

vikas jain

  • Feb 17th, 2006
 

can you please explain, why u have used delete for the abnormal termination.

  Was this answer useful?  Yes

Eugene

  • Mar 6th, 2006
 

I would do in this way:

create 2 new steps- in the very beginning of your JCL

//JS05    exec pgm=iefbr14     <=== delete data set as run starts

//dd01    dd dsn=<your file name>,

// disp=(mod,delete,delete),unit=sysda,space=(trk,1)

//JS06    exec pgm=iefbr14     <=== create data set as run starts

//dd01    dd dsn=<your file name>,

// disp=(new,catlg,catlg),

//unit=sysda,space=....................,DCB=..................

Then in that step(s) you want to update this file, set for it

//.............   disp=mod,               can be also "old" depending on your logic -

i.e. if you want to add data to what was there - mod, if just read or overwrite - old 

//   unit=....,

After abend you will restart from from any step after JS06 and your data set is kept.

In any new run it will be deleted and created in the very beginning of the job.

  Was this answer useful?  Yes

Chandru

  • Aug 19th, 2006
 

U can use... DISP=(MOD,DELETE,KEEP)

This will create the dataset if it is not present... Deletes the dataset in case of Normal Execution and KEEPs the dataset in case of abnormal termination and the file can be used in the next run as the disp it is MOD.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions