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

Do NOT want a GDG created if the data is bad


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

New User


Joined: 10 Nov 2006
Posts: 7

PostPosted: Fri Nov 10, 2006 4:04 am
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Nov 10, 2006 4:57 am
Reply with quote

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
View user's profile Send private message
Youbee

New User


Joined: 10 Nov 2006
Posts: 1

PostPosted: Fri Nov 10, 2006 5:56 am
Reply with quote

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
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Fri Nov 10, 2006 9:24 am
Reply with quote

Code:
COND=(0,EQ,STEP10)


takes care of that.
Back to top
View user's profile Send private message
UB

New User


Joined: 10 Nov 2006
Posts: 7

PostPosted: Fri Nov 10, 2006 6:21 pm
Reply with quote

TizMe wrote:
Code:
COND=(0,EQ,STEP10)


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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Nov 10, 2006 7:06 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Nov 10, 2006 7:18 pm
Reply with quote

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
View user's profile Send private message
UB

New User


Joined: 10 Nov 2006
Posts: 7

PostPosted: Fri Nov 10, 2006 8:49 pm
Reply with quote

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
View user's profile Send private message
UB

New User


Joined: 10 Nov 2006
Posts: 7

PostPosted: Fri Nov 10, 2006 9:47 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Nov 10, 2006 11:30 pm
Reply with quote

The COND goes on the following step STEP10A that optionally deletes your (+1) file, not STEP10.
Back to top
View user's profile Send private message
UB

New User


Joined: 10 Nov 2006
Posts: 7

PostPosted: Fri Nov 10, 2006 11:42 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Nov 11, 2006 7:40 pm
Reply with quote

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
View user's profile Send private message
rahul_kolhe

New User


Joined: 08 Nov 2006
Posts: 15

PostPosted: Sun Nov 12, 2006 11:18 am
Reply with quote

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
View user's profile Send private message
UB

New User


Joined: 10 Nov 2006
Posts: 7

PostPosted: Sun Nov 12, 2006 12:03 pm
Reply with quote

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
View user's profile Send private message
UB

New User


Joined: 10 Nov 2006
Posts: 7

PostPosted: Mon Nov 13, 2006 6:32 pm
Reply with quote

Here is the link. Hope this helps. I corrected my problem by looking at example code. The explanation here did not mean a lot to me.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/FRAMESET/ceea100/7.3.1?ACTION=MATCHES&REQUEST=plidump&TYPE=FUZZY&SHELF=&DT=19960122163739&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top