IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Catalog an empty dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amar naik

New User


Joined: 29 Aug 2007
Posts: 8
Location: NY

PostPosted: Fri Sep 21, 2007 1:15 am
Reply with quote

I am having an input dataset called PRWTSSS.DNLD.INPSTM.DXYYDDD1. This is created by a different system. If the file is empty then predecessor job does not catalog the file. So our jobs fail. i tried the below step

Code:

//STEP0100 EXEC PGM=IEFBR14
//*
//FILE01 DD DSN=YOUR MISSING FILE,
// DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)
//*

but it will create a dataset by the name PRWTSSS.DNLD.INPSTM.DXYYDDD1, if it does not exist. Our system does not have permissions to create a file with high level qualifier as PRWTSSS.


I can use the below code to check if a dataset exists
Code:


//*************************************                 
//* RC=0  - DATASET HAS RECS          *                 
//* RC=4  - DATASET EMPTY             *                 
//* RC=12 - DATASET NOT FOUND         *                 
//*************************************                 
//STEP0100 EXEC PGM=IDCAMS                             
//SYSPRINT DD SYSOUT=*                                 
//SYSIN    DD *                                         
 PRINT IDS('PRWTSSS.DNLD.INPSTM.DXYYDDD1') CHARACTER COUNT(1)
/* 

The last qualifier in file DXYYDD1 is populated run time. For 20th sept it will be DX072831 etc

so my problem is not yet resolved. Please advise.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Fri Sep 21, 2007 1:27 am
Reply with quote

You can write a SORT statement to create the PRINT IDS card with required date format, and then use this output file as SYSIN in your IDCAMS.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 21, 2007 1:36 am
Reply with quote

Are you planning on continuing this topic at this site or are you going to continue it at both sites.
Back to top
View user's profile Send private message
amar naik

New User


Joined: 29 Aug 2007
Posts: 8
Location: NY

PostPosted: Fri Sep 21, 2007 1:39 am
Reply with quote

both sites..i am just trying to get the answer...once i get answer i will post it
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Sep 21, 2007 1:39 am
Reply with quote

So this

Code:

//*************************************                 
//* RC=0  - DATASET HAS RECS          *                 
//* RC=4  - DATASET EMPTY             *                 
//* RC=12 - DATASET NOT FOUND         *                 
//*************************************                 
//STEP0100 EXEC PGM=IDCAMS                             
//SYSPRINT DD SYSOUT=*                                 
//SYSIN    DD *                                         
 PRINT IDS('PRWTSSS.DNLD.INPSTM.DX072831') CHARACTER COUNT(1)
/* 


ought to work for you.
Back to top
View user's profile Send private message
amar naik

New User


Joined: 29 Aug 2007
Posts: 8
Location: NY

PostPosted: Fri Sep 21, 2007 1:44 am
Reply with quote

yes, but my problem is that my file name keeps chaging

file name will be
PRWTSSS.DNLD.INPSTM.DX072831 on 10th oct
PRWTSSS.DNLD.INPSTM.DX072841 on 11th oct..
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Sep 21, 2007 1:52 am
Reply with quote

Yeah, I know, I got the point from the original post.

Obviously, you need to create a utility that will provide the proper value for the dataset name to the IDCAMS program for that run. Devzee offered one suggestion, but you have plenty of options to take advantage of. It would help us to know what the algorithm you're using for that field (some sort of Julian date??) is.
Back to top
View user's profile Send private message
amar naik

New User


Joined: 29 Aug 2007
Posts: 8
Location: NY

PostPosted: Fri Sep 21, 2007 1:53 am
Reply with quote

yes it is julian date
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Sep 21, 2007 1:56 am
Reply with quote

amar naik wrote:
both sites..i am just trying to get the answer...once i get answer i will post it
Don't let Kolusu catch you..... icon_eek.gif
Back to top
View user's profile Send private message
amar naik

New User


Joined: 29 Aug 2007
Posts: 8
Location: NY

PostPosted: Fri Sep 21, 2007 1:58 am
Reply with quote

I am just looking for help. Kolusu has been kind enough to help me. since i was not getting any response i was googling around. i found the reference to this website. so hopefully he understands.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Sep 21, 2007 3:43 am
Reply with quote

amar naik wrote:
hopefully he understands.
Hopefully, yes, maybe.... icon_question.gif
Read the forum rules and attempt to abide by them (no matter how draconian they may seem)....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top