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

JCL DISP parameter


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

New User


Joined: 21 Feb 2007
Posts: 72
Location: US

PostPosted: Tue May 17, 2011 3:21 pm
Reply with quote

Hi,

I require your help on this.

I have a JCL step where a GDG is coded with DISP = (new,catlg,delete). In the same step I have a COBOL program which basically writes into this GDG afer reading from a table

Now if the job fails with -904 SQL error, would the GDG which has been created earlier with DISP = (new,catlg,delete) be deleted or not ?

Regards,
Ashok
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue May 17, 2011 3:26 pm
Reply with quote

No,

Disposition only applies to the step, not the entire job. If that step completed and the new GDG was cataloged, it will stay cataloged.
Back to top
View user's profile Send private message
ashok_uddaraju

New User


Joined: 21 Feb 2007
Posts: 72
Location: US

PostPosted: Tue May 17, 2011 3:28 pm
Reply with quote

both the actions were being performed in the same step
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 17, 2011 3:40 pm
Reply with quote

let us correct terminology, and perhaps you can find the answer:

it is:
the DISP parameter for the JCL DD Statement.

you have a JOB step.

a JOB step defines some activity to the op-system.
in this case it is execution of a COBOL program,
which has an output dataset defined as a GDG
with disp parms of new,cat,del.

now, not JOBS, not STEPs, not even programs fail due to negative SQL return codes.
what action your program takes when it receives a -904 SQL code,
only your program can tell you.

what action does the program take, when it recieves a -904?

only an abend of the program will cause the DELETE action of the DISP parm to activate.

a non-zero return code of a program is not an abend.
if your program does not abend
(now could be a good time to read about abnormal termination of a program and learn what the op-system considers an ABEND to be.)
then you need a following step, which interrogates the return-code of your program, and take appropriate action - i.e. delete the output file of the COBOL program.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue May 17, 2011 3:42 pm
Reply with quote

If a job step abends, then any dataset created in that step with a (NEW,CATLG,DELETE) disposition should be scratched. That is the definition of the DELETE parameter in that case. I'm not aware of any reason that a GDG would not follow this rule.
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 Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top