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

SET RC=4 when MEMBER NOT FOUND


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

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Wed Sep 23, 2009 10:37 am
Reply with quote

Hi, I am trying to delete the specific list of members from the 10 different PDS.

After the success DELETE I am getting RC=0 which is what I expeted but if the member is NOT PRESENT in the data set then I am getting RC = 8.

Code:

//STEP1 EXEC PGM=IDCAMS               
//SYSPRINT DD SYSOUT=*                 
//PDS      DD DSN=TOPPXXX.DATA,DISP=SHR
//SYSIN    DD *                       
  DELETE  TOPPXXX.DATA(TEMP) FILE(PDS)
/*                                     


My Question is is there a way I can get RC=4 if the Member not found?

I am using the IDCAMS can some one please help me if I can use any other utility or using some parameter I can change the RC of the STEP during the member not found.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Sep 23, 2009 10:57 am
Reply with quote

Hi,

what's wrong with a rc of 8.

If you really need to amend it, you can just add
Code:
IF LASTCC = 8 THEN SET MAXCC = 4



Gerry
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 10:59 am
Reply with quote

Quote:
I am using the IDCAMS can some one please help me if I can use any other utility or using some parameter I can change the RC of the STEP during the member not found.


The terminology is wrong.
from a JCL point of view a STEP RC cannot be changed once the step has terminated.

the inner processing of idcams will let You achieve what You want,
idcams will let You modify/set the return code of an IDCAMS command
which in turn will be reflected on the STEP RC

read the IDAMS manuals for the exact details ...
here is a snippet anyway

Code:
<any idcams command> ( DELETE in Your case
IF LASTCC = 8 THEN DO
    SET LASTCC = 4
    SET MAXCC = 4
END
 
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 11:05 am
Reply with quote

follow on...
I was going to ask what was wrong in checking for an 8 RC...
but since this morning I am in a good mood I am giving one reason for wanting a 4 RC

usually ...
0 means no errors
4 means warning
8 means error

so from an esthetics point of wiew deleteing a non existing member might deserve a warning and not an error RC icon_biggrin.gif
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Wed Sep 23, 2009 11:24 am
Reply with quote

RC 8 is an ERROR and not accepted in job processing in our SYSTEM. For my scenario I was not sure how to do the deletion of a members in 10 different datasets.

I managed to create JCL using a Program and submit them through INTRDR but the created JCL started failing because MEMBER NOT FOUND.

I tried many options but with my knowledge I could not think of changing anything other than RC = 8 to RC = 4.

I know I am trying to force RC 8 to RC 4. With my senario can you please let me know the approach I am taking is accepted or I must achieve using a dirrefent way.

I even tried to check the MEMBER is present in the dataset before Deletion using ICETOOL. But ICETOOL check's if the MEMBER is EMPTY or NOT and if member is not present then it will provide RC 12.

With all the above try I was thinking to change the RC 8 to RC 4.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 11:34 am
Reply with quote

Looks like You did not read the posts giving You the solution to Your problem icon_evil.gif

we posted two IDCAMS snippets to be added to Your <delete> stuff,
to make You understand better her is the full JCL stream ( jcl + idcams commands )

Code:

//STEP1 EXEC PGM=IDCAMS               
//SYSPRINT DD SYSOUT=*                 
//PDS      DD DSN=TOPPXXX.DATA,DISP=SHR
//SYSIN    DD *                       
  DELETE  TOPPXXX.DATA(TEMP) FILE(PDS)
  IF LASTCC = 8 THEN DO
    SET LASTCC = 4
    SET MAXCC = 4
  END


and read the idcams manual at
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2I260/CCONTENTS?SHELF=DGT2BK71&DN=SC26-7394-07&DT=20080123101112

looking at the IF, SET, LASTCC, MAXCC
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Wed Sep 23, 2009 11:39 am
Reply with quote

Hi sorichetti,

I am sorry, But I tried the solution provided by you and it worked for me before you posted the complete JCL.

I am not good in explaining but in last post I was trying to explain what I was doing.

Again Thank you for help.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 11:48 am
Reply with quote

if You simply had written thanks it worked...
and I had already given an explanation why wanting a 4 RC was a reasonable desire

and ... thats my last name, my first name is enrico...

addressing people using only the last name without adding a proper title is considered rude .
acceptable titles in my case are Mr. or Dr. icon_cool.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Sep 23, 2009 11:55 am
Reply with quote

I agree with Mr. Sorichetti...(it sounds like Mr. Anderson from the movie _ _ _ icon_wink.gif )
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 11:57 am
Reply with quote

Thank You, Your Honor icon_biggrin.gif
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Wed Sep 23, 2009 10:29 pm
Reply with quote

Hi my mistake I apologies.

I will take care of everything in my further postings.

I am struck with another problem since due to Multiple deletions.

My SORT INPUT File contains only the member names. like as below

Code:
TEMP1
TEMP2
TEMP3


I was able to format the cards as below.
Code:
DELETE  TOPPXXX.DATA(TEMP1) FILE(PDS)
DELETE  TOPPXXX.DATA(TEMP2) FILE(PDS)
DELETE  TOPPXXX.DATA(TEMP3) FILE(PDS)


Once they are formatted I was using then in SYSIN for IDCAMS.

Thank you for providing the solution on setting RC to 4 but currently
I am not able to introduce the new record after every record from the input file.

Code:
DELETE  TOPPXXX.DATA(TEMP1) FILE(PDS)
IF LASTCC = 8 THEN DO SET LASTCC = 4 SET MAXCC = 4 END
DELETE  TOPPXXX.DATA(TEMP2) FILE(PDS)
IF LASTCC = 8 THEN DO SET LASTCC = 4 SET MAXCC = 4 END
DELETE  TOPPXXX.DATA(TEMP3) FILE(PDS)
IF LASTCC = 8 THEN DO SET LASTCC = 4 SET MAXCC = 4 END


Kindly please let me know is there a way to achieve above formating or this must be done using a program?

Thanks
Venkat.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 10:38 pm
Reply with quote

there is no need to insert the if after every delete...
it should be enough to insert as the last card

IF MAXCC = 8 THEN SET MAXCC = 4

should be easily doable , there are a few samples around ( trailer something IIRC)
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Wed Sep 23, 2009 11:06 pm
Reply with quote

Hi Mr. Sorichetti,

Thank you for your help. This works good for me.

Thanks
Venkat.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 11:12 pm
Reply with quote

Hi Venkat,
glad it worked ! thanks for telling
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 How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
No new posts Searching for a member but don't know... TSO/ISPF 6
No new posts Looking For a PDS Member Without Open... PL/I & Assembler 10
No new posts A directory in the pathname was not f... ABENDS & Debugging 0
Search our Forums:

Back to Top