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
 

 

IDCAMS to check for an empty file in PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 6:42 pm    Post subject: IDCAMS to check for an empty file in PDS
Reply with quote

Can we use IDCAMS to check for an empty file if the file in question is a PDS?

Please let me know if there are any other means to do this excluding PDSFAST.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 24, 2009 6:56 pm    Post subject:
Reply with quote

DFSORT
REXX
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 6:59 pm    Post subject:
Reply with quote

Thanks Expat,

so your answer means that we cannot check if a PDS is empty using IDCAMS??

Sorry to bother you...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 24, 2009 7:25 pm    Post subject:
Reply with quote

Sorry about that, misread you original post.

Yes, you can use IDCAMS. PRINT parameter, will return 4 if no records in file.
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 7:34 pm    Post subject:
Reply with quote

Thanks Expat,

I tried giving the following JCL

//IDCCHEK2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//DDIN DD DISP=SHR,DSN=TEST.PDS.TEST
//SYSIN DD *
PRINT INFILE(DDIN)
/*

but got a RC=12 and with the following messages

IDC3302I ACTION ERROR ON KDRV00.PDS.TEST
IDC3313I ** ,JOBC1,IDCCHEK2,BBA3,D,DDIN ,
READ ,WRNG.LEN.RECORD,0000019B000000,BSAM

Could you let me know if I coded the PRINT command correctly
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 7:37 pm    Post subject:
Reply with quote

To add more to my note
I tried to use the same JCL to print a sequential dataset and my job ran fine.

Could you please let me know if I'm doing this right
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 24, 2009 7:49 pm    Post subject:
Reply with quote

If you're going to use IDCAMS to check a PDS, you must be checking a member -- not the PDS. The wrong length record comes about when IDCAMS attempts to read the data set, finds the first directory record (which is 256 bytes) and discovers the LRECL is not the same length as the data read.

What would it mean for a PDS to be empty? No members? If so, you'll need some other way besides IDCAMS to check it since IDCAMS needs a member name.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 24, 2009 7:49 pm    Post subject:
Reply with quote

I would use the COUNT(1) so that if there is 1 or more records in the file the RC will be 0, and if none the RC will be 4

Looks like you are trying to print a PDS, you need to specify a member name if it is a PDS.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Nov 24, 2009 7:54 pm    Post subject: Reply to: IDCAMS
Reply with quote

IIRC, if you need to suppress all printing, specify COUNT(0), then there aren't any security issues raised if the data contains sensitive/proprietary information.

Bill
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 7:57 pm    Post subject:
Reply with quote

Thank you both, I agree with you that we cannot check if a PDS file is empty until and unless if we check for a particular member in the PDS in IDCAMS....

but if you find any new way of doing this thru IDCAMS please let me know and I would be the happiest person.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 24, 2009 7:59 pm    Post subject:
Reply with quote

If you limit yourself to IDCAMS, you cannot check whether the entire PDS is empty. IDCAMS was not really designed to handle PDS files, so it is not a very good choice of tool for manipulating a PDS.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 24, 2009 8:04 pm    Post subject:
Reply with quote

Maybe if you gave a little more information on exactly what you want to achieve, then maybe we could be more helpful
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 8:06 pm    Post subject:
Reply with quote

Sure, but what amazes me is that I've an entire occean but still thirsting for a single drop

Once again my sincere thanks to one and all, sorry to bother you much....

Regards,
Ravi
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Tue Nov 24, 2009 8:07 pm    Post subject: Reply to: IDCAMS
Reply with quote

Quote:
Can we use IDCAMS to check for an empty file if the file in question is a PDS?


You can use IDCAMS/SORT to check for an empty member
not for an empty PDS directory!
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 8:08 pm    Post subject:
Reply with quote

Hi Expat,

Well we had a scenario where we need to check if the incoming PDS file is empty .....

We mentioned other aleternatives like IEBCOPY, ICETOOL, PDSFAST but the client wants to know whether we could achieve it thru IDCAMS and thus began the story.....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 24, 2009 8:23 pm    Post subject:
Reply with quote

Clarify empty.

PDS has no members or PDS has members but all are empty
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Tue Nov 24, 2009 8:29 pm    Post subject:
Reply with quote

We need to check if the PDS has no members or containing some memebers in it
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 24, 2009 9:04 pm    Post subject:
Reply with quote

Easy peasy in REXX
Code:
/* REXX *** LIST PDS AND SEE IF MEMBERS EXIST             */
 ADDRESS ISPEXEC "CONTROL ERRORS RETURN"                               
 "FREE  FI(SYSPRINT)"                                                   
 "ALLOC FI(SYSPRINT) SYSOUT(Z)"                                         
 PDS = "Pds Name"                                                   
 X = MSG('OFF')                                                         
 X=OUTTRAP(LIST.)                                                       
 "LISTDS '"PDS"' MEM "                                                 
 X=OUTTRAP(OFF)                                                         
 IF LIST.0 <= 6
   THEN EXIT  0
   ELSE EXIT 16
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Thu Nov 26, 2009 12:26 pm    Post subject:
Reply with quote

Thanks All, I gave all these options to my client and I need to wait for his choice, Once again I'm very grateful to each one of you for your wonderful suggestions
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Thu Nov 26, 2009 3:37 pm    Post subject: Reply to: IDCAMS
Reply with quote

Quote:
I gave all these options to my client


looks like the forums are getting more and more like some kind of ..
sub-outsourcing and even free of charge icon_evil.gif
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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