View previous topic :: View next topic
|
Author |
Message |
UB
New User
Joined: 10 Nov 2006 Posts: 7
|
|
|
|
What am I doing wrong? I've spent about an hour searching through these forums to find an answer but all I'm finding is that I have everything coded correctly.
My problem:
I have a PLI program which reads a GDG and writes to the same GDG. If the data fail edit check I tell the program to blow-up. If the program fails it should fail the step and cause the new GDG (+1) to be deleted. However, the new GDG is always there. I even tried to write to a different GDG file name and it was still there.
My PLI code does an edit check on data and if found to be bad I SYSTEM ERROR, set PLIRETC(16) (I even tried 20) and end the program. I receive a 1016 or 1020 as my return code but I still have the GDG.
As you can see my Disp is coded correctly:
Code: |
//STEP10 EXEC PLIXG,
// PROG=PROGRAM
//FILE1 DD DSN=FILE.QUALIFY.FILE1,
// DISP=(SHR,KEEP,KEEP)
//FILE2I DD DSN=FILE.QUALIFY.FILE2(0),
// DISP=(SHR,KEEP,KEEP)
//FILE2O DD DSN=FILE.QUALIFY.FILE2(+1),
// DISP=(NEW,CATLG,DELETE),
// DCB=(SYST15.DSCB,RECFM=FB,LRECL=440,BLKSIZE=0,DSORG=PS),
// SPACE=(CYL,(100,10),RLSE)
//RECAP DD SYSOUT=(,),
// OUTPUT=(*.OUTT),
// DCB=(DSORG=PS,RECFM=FBA,LRECL=133,BLKSIZE=0)
//SYSIN DD DSN=FILE.QUALIFY.JCL(RPLDEL),DISP=SHR
/* |
This is the only step in this JCL and I do NOT want a GDG created if the data is bad.
TIA |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
TIA,
Hi ,
I?m not a PLI guy, but it sounds as if you are not abending the program, but terminating with a return code. JES looks at this differently than if the program abended.
Try putting this set after your PLI program
Code: |
//STEP10A EXEC PGM=IEFBR14,COND=(0,EQ,STEP10)
//DDOUT DD DSN=FILE.QUALIFY.FILE2(+1),
// DISP=(OLD,DELETE,DELETE)
|
It will delete the new gen if STEP10 returns anything but a RC=0000.
Dave |
|
Back to top |
|
|
Youbee
New User
Joined: 10 Nov 2006 Posts: 1
|
|
|
|
I believe I somehow irratated someone for my user name was disabled. Therefore, I've had to relogon under a new name. Sorry for what ever I did.
Quote: |
I?m not a PLI guy, but it sounds as if you are not abending the program, but terminating with a return code. JES looks at this differently than if the program abended. |
I tend to agree with your analisys. However, I don't believe your solution will work for me. If I understand that Disp correctly, it will delete the file after a completion code of 0000. I don't want that to happen either. |
|
Back to top |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
takes care of that. |
|
Back to top |
|
|
UB
New User
Joined: 10 Nov 2006 Posts: 7
|
|
|
|
TizMe wrote: |
takes care of that. |
Thanks for your reply but Step10 is the only step in this job. It is also the step which is causing the problem. Am I not correct in saying the above code would prevent step10 from running if the previous step failed? However, there is no previous step. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
First, the original replyer is correct - the third DISP field is used for ABEND's, not just return codes you might consider to be "fail" codes.
Second, the COND says when to bypass a step (always a great tech interview question), so the STEP10A will be bypassed if STEP10 has return cope=00; otherwise, it will run, thereby deleting the new (+1) generation.
Same GDG or diff - it does not matter. You cannot create two new gens in the same step for the same GDG, but you're not doing that, so that part is OK. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
With a little bit of testing, I'll back Dave's assessment. If the program truly ABENDS, the new generation is deleted (based on the DISP of DELETE). The new generation will be created and cataloged for any other condition. |
|
Back to top |
|
|
UB
New User
Joined: 10 Nov 2006 Posts: 7
|
|
|
|
superk wrote: |
With a little bit of testing, I'll back Dave's assessment. If the program truly ABENDS, the new generation is deleted (based on the DISP of DELETE). The new generation will be created and cataloged for any other condition. |
I did not have time to test this, this morning for I had a meeting but I did want to try it anyway. As coded this does not work.
Code: |
//STEP10 EXEC PLIXG,
// PROG=PROGRAM,
// COND=(0,EQ,STEP10) |
I receive an invalid referback on Step10. However, I made a change and I am able to run the JCL but I receive the same results.
My change:
Code: |
//STEP10 EXEC PLIXG,
// PROG=PR573,
// COND=(0,EQ) |
|
|
Back to top |
|
|
UB
New User
Joined: 10 Nov 2006 Posts: 7
|
|
|
|
I still need to research why but it appears the problem lied in the PLI just as DavidatK above had suggested. My PLIDUMP was coded with:
Code: |
CALL PLIDUMP('FBSHAT'); |
This returns a 1016 in JES.
The correct code is:
Code: |
CALL PLIDUMP('FBCHAT'); |
This returns a U4038 in Jes and makes all the difference in whether or not the new GDG is deleted.
Thanks to everyone for their input. Had I known this was a PLI problem would have placed this in the appropriate forum. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
The COND goes on the following step STEP10A that optionally deletes your (+1) file, not STEP10. |
|
Back to top |
|
|
UB
New User
Joined: 10 Nov 2006 Posts: 7
|
|
|
|
Phrzby Phil wrote: |
The COND goes on the following step STEP10A that optionally deletes your (+1) file, not STEP10. |
Thanks but I didn't want a second step. This was all suppose to work with just the one step.
The problem is solved and was located in the PLI. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
UB,
Why don't you share your solution with us? There may be some out here that may (or will) need the info as you did when you asked. |
|
Back to top |
|
|
rahul_kolhe
New User
Joined: 08 Nov 2006 Posts: 15
|
|
|
|
Hi,
It looks like problem was with the error routine in the program which was not passing the abend code from the program to the JCL but was only passing the return code and that is why program was terminating with the return code and was not abending. With the new error routine it must be passing 4038 if signals error.
UB, can you find the code for FBSHAT and FBCHAT both, which will explain the reason why U4038 was passed when you used FBCHAT. This will help all.
Thanx |
|
Back to top |
|
|
UB
New User
Joined: 10 Nov 2006 Posts: 7
|
|
|
|
mmwife wrote: |
UB,
Why don't you share your solution with us? There may be some out here that may (or will) need the info as you did when you asked. |
I did share my solution. Look two posts above your last post. The problem was one letter in my call to PLIDUMP which was located in my PLI program.
It appears the letter 'S' was the culprit. Despite the fact I had blown up the program and this was the last line of code, the letter 'S' in that line of code terminates the program operation and returns to Jes normally. It was just displaying a 1016 return code but was NOT detecting the abend and thus not cleaning up the new GDG file.
Therefore, removing the letter 'S' from this line of code or replacing it with the letter 'C' will cause the program to complete and return to Jes as an abend.
Sorry, if I wasn't clear on that earlier. I'm not clear on the actual meaning of the all the letters in this call to PLIDUMP.
DavidatK called it in his post when he suggested I was not actually abending the program but rather setting a condition code but terminating normally. That got me looking more closely at my program and less at my JCL. I did NOT want to add a second step. That was more of a work around for something that should have been working.
Quote: |
UB, can you find the code for FBSHAT and FBCHAT both, which will explain the reason why U4038 was passed when you used FBCHAT. This will help all. |
I'm at home now and do not have the link here. I know I found the reference on the IBM website under PLI language stuff but I can not find the actual link from here. Sorry. If I remember on Monday, I'll try to post the link which has the meaning to each of those letters. |
|
Back to top |
|
|
UB
New User
Joined: 10 Nov 2006 Posts: 7
|
|
Back to top |
|
|
|