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
 

 

SET RC=4 when MEMBER NOT FOUND

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SET RC=4 when MEMBER NOT FOUND
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: 1703
Location: Australia

PostPosted: Wed Sep 23, 2009 10:57 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 23, 2009 10:59 am    Post subject: Reply to: SET RC=4 when MEMBER NOT FOUND
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 23, 2009 11:05 am    Post subject: Reply to: SET RC=4 when MEMBER NOT FOUND
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 23, 2009 11:34 am    Post subject: Reply to: SET RC=4 when MEMBER NOT FOUND
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
http://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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 23, 2009 11:48 am    Post subject: Reply to: SET RC=4 when MEMBER NOT FOUND
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

Senior Member


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

PostPosted: Wed Sep 23, 2009 11:55 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 23, 2009 11:57 am    Post subject: Reply to: SET RC=4 when MEMBER NOT FOUND
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 23, 2009 10:38 pm    Post subject: Reply to: SET RC=4 when MEMBER NOT FOUND
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 23, 2009 11:12 pm    Post subject: Reply to: SET RC=4 when MEMBER NOT FOUND
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    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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts File Stauts 92 with member of PDS sandip_mainframe COBOL Programming 4 Fri Jun 10, 2016 12:06 pm
No new posts how to extract the member name ? jackzhang75 CLIST & REXX 1 Wed Feb 17, 2016 9:21 pm
No new posts Check if a member is present in libra... enrico-sorichetti All Other Mainframe Topics 1 Wed Feb 03, 2016 12:29 pm
No new posts Editing "member generations"... Ricardo Viegas TSO/ISPF 1 Tue Dec 29, 2015 7:27 pm


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