View previous topic :: View next topic
|
Author |
Message |
ashok_uddaraju
New User
Joined: 21 Feb 2007 Posts: 72 Location: US
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
ashok_uddaraju
New User
Joined: 21 Feb 2007 Posts: 72 Location: US
|
|
|
|
both the actions were being performed in the same step |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
|