Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Catalog an empty dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Catalog an empty dataset
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    Post subject:
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Sep 21, 2007 1:39 am    Post subject: Reply to: Catalog an empty dataset
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Sep 21, 2007 1:52 am    Post subject: Reply to: Catalog an empty dataset
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Fri Sep 21, 2007 1:56 am    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Fri Sep 21, 2007 3:43 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us