View previous topic :: View next topic
|
Author |
Message |
koteswara
New User
Joined: 23 Sep 2009 Posts: 22 Location: Bangalore
|
|
|
|
Is there any equivalent to cobol compiler option for
SELECT [OPTIONAL] FILE NAME ASSIGN TO DDNAME
Job is running successfully after commenting the DDNAME in the JCL as well. Program does not contain the Optional clause. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Your post does not make sense. The COBOL statement SELECT OPTIONAL is not an option, it is a statement.
And if the program does not contain the OPTIONAL clause, the DD name must be present in the JCL for the program to execute correctly.
Post the job output and relevant COBOL code in BBcode format for review. And restate your question so it makes sense. |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
Always try to post your question in a way others can understand. If not we cannot help you much. |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
Robert Sample wrote: |
if the program does not contain the OPTIONAL clause, the DD name must be present in the JCL for the program to execute correctly. |
Actually, under Enterprise COBOL, this is not always true. The Programmer's Guide says:
"3. If neither a ddname nor an environment variable is defined, the following steps occur: a. If the allocation is for a QSAM file and the CBLQDA runtime option is in effect, CBLQDA dynamic allocation processing takes place for those eligible files. This type of ″implicit″ dynamic allocation persists for the life of the run unit and cannot be reallocated. b. Otherwise, the allocation fails. The COBOL run time deallocates all dynamic allocations at run unit termination, except for implicit CBLQDA allocations."
A while back I spelled an output DDNAME wrong and had a difficult time figuring out why my output dataset was not being populated. The program did NOT abend, and appeared to execute "correctly" according to the SYSOUT message log. It wasn't until I checked the allocation/deallocation messages that I discovered the error. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I didn't think about the LE CBLQDA option -- I stand corrected. The lesson is to always check the allocation messages to ensure the files you think are being allocated actually are! |
|
Back to top |
|
|
koteswara
New User
Joined: 23 Sep 2009 Posts: 22 Location: Bangalore
|
|
|
|
Hi All,
Thanks for all the responses.File Status "35" is handled in the program,Hence the Job is running.
OPEN INPUT ABCD.
IF ABCD-FILE-STATUS = AA35
PERFORM AX-LOCK-TABLES
PERFORM BY-LOAD-AUTHORITY
MOVE AZ99 TO HD-REC-COUNT
PERFORM BXY-PROCESS-NORESP
PERFORM BZA-RECON-REPORT
PERFORM C50-FINAL
STOP RUN
END-IF. |
|
Back to top |
|
|
|