|
View previous topic :: View next topic
|
| Author |
Message |
MIMI Warnings : 1 New User

Joined: 09 Jan 2006 Posts: 20
|
|
|
|
I new user and thanks lot for your help
I want to know how to catalog dataset in JCL or mainframe.
I even don't know what is catalog mean?
Why need to catalog and what is different from the allocate dataset?
Please take a little time to explain me and I much appreciate your help.
Thanks lot
MiMi |
|
| Back to top |
|
 |
LeonL
New User
Joined: 20 Jan 2006 Posts: 5
|
|
|
|
Hi MiMi,
In your JCL use DISP=(NEW,CATLG,DELETE).
This means:
1) You're creating a NEW data set
2) If the job step completes successfully the data set should be cataloged
3) If the job step ABENDs the data set should be deleted.
Cataloging a data set means the name of the data set, allocation data (like VOLUME, LRECL, RECFM etc.) are added to one of the system catalogs.
When you need the data set again, you don't have to know any of these parameters, just use DSN=data.set.name,DISP=SHR and the system will know on which volume this data set resides.
Regards,
Leon |
|
| Back to top |
|
 |
mmwife
Super Moderator

Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi MIMI,
Just to add to Leon's comments:
If you update the file after you create it, use disp=old instead of disp=shr. This prevents anyone from using your ds when you update. Allowing someone else access at that time can cause problems for you, them or both.
As I recall the DCB params (LRECL, RECFM, etc.) are carried in the DSCB on which the file was allocated, not the Catalog... unless they changed it recently. Minor point, but it s/b noted. |
|
| Back to top |
|
 |
Bitneuker
CICS Moderator

Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Yo MIMI,
I'd also like to ad to the comments. Normally a job will run more than once using the same JCL. You should prevent failure when your job tries to construct/catalog the dataset (you can't create a dataset with disp=new when it already exists unless it's not catalogued and resides on different volumes). We use to insert a small step at the beginning of the job which takes care of that.
//DELETE EXEC PGM=IEFBR14 (just an exit without functionality)
//SYSOUT DD SYSOUT=*
//DD1 DD DSN=dataset-to-delete,DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=TRK,0)
the MOD is meant to prevent a condition code 4 in case the dataset didn't exist.
Cheers, |
|
| Back to top |
|
 |
|
|