View previous topic :: View next topic
|
Author |
Message |
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
DFSORT
REXX |
|
Back to top |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
Thanks Expat,
so your answer means that we cannot check if a PDS is empty using IDCAMS??
Sorry to bother you... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Clarify empty.
PDS has no members or PDS has members but all are empty |
|
Back to top |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
We need to check if the PDS has no members or containing some memebers in it |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
Back to top |
|
|
|