View previous topic :: View next topic
|
Author |
Message |
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
Back to top |
|
|
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Looks like You did not read the posts giving You the solution to Your problem
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 |
|
|
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I agree with Mr. Sorichetti...(it sounds like Mr. Anderson from the movie _ _ _ ) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Thank You, Your Honor |
|
Back to top |
|
|
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
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
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
Hi Mr. Sorichetti,
Thank you for your help. This works good for me.
Thanks
Venkat. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Hi Venkat,
glad it worked ! thanks for telling |
|
Back to top |
|
|
|