Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Job Didn't fail when CBLQDA is ON

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu May 14, 2015 4:05 pm    Post subject: Job Didn't fail when CBLQDA is ON
Reply with quote

Hi,

In my COBOL program the file select is as below:
Code:
001800  FILE-CONTROL.
001900       SELECT ATMVALUX ASSIGN TO UT-S-ATMVALUX       
001910        FILE STATUS IS W01-ATMBVX-STATUS.           
002000       SELECT ATMFICOM ASSIGN TO UT-S-ATMFICOM
002010        FILE STATUS IS W01-ATMFICOM-STATUS.   


There are two scenarios in my JCL and please advise why the JOB is not failing:
Scenario 1:
I am giving wrong file in JCL which doesn't match to COBOL SELECT file i.e. ATMFICOM is not equal to DDDDDDDD in JCL and the job is not abending but its not writing to the output file :
Code:
 000021 //STP03#06 EXEC PGM=AAAAAAAA                                   
000022 //STEPLIB  DD  DSN=PPPPPPP.PPPP.LINKLIB,DISP=SHR               
000023 //SYSUDUMP DD  SYSOUT=*                                         
000024 //SYSABOUT DD  SYSOUT=*                                         
000025 //SYSDBOUT DD  SYSOUT=*                                         
000026 //SYSPRINT DD  SYSOUT=*                                         
000027 //SYSOUT   DD  SYSOUT=*                                         
000028 //ATMVALUX DD  DSN=PPPPPPPP.AAAAAAAA.SRT,DISP=SHR   INPUT       
000029 //DDDDDDDD DD  DSN=BBBBBBB.BBBBBBBB,DISP=OLD        OUTPUT


Scenario 2:
I am not giving any output file JCL which doesn't match to COBOL SELECT file i.e. DDDDDDDD is commented and the job is not abending and it is generating temp file SYS15134.T101419.RA000.MYIDICOM.R0126127 :
Code:
 000021 //STP03#06 EXEC PGM=AAAAAAAA                                   
000022 //STEPLIB  DD  DSN=PPPPPPP.PPPP.LINKLIB,DISP=SHR               
000023 //SYSUDUMP DD  SYSOUT=*                                         
000024 //SYSABOUT DD  SYSOUT=*                                         
000025 //SYSDBOUT DD  SYSOUT=*                                         
000026 //SYSPRINT DD  SYSOUT=*                                         
000027 //SYSOUT   DD  SYSOUT=*                                         
000028 //ATMVALUX DD  DSN=PPPPPPPP.AAAAAAAA.SRT,DISP=SHR   INPUT       
[color=red]000029 //*DDDDDDDD DD  DSN=BBBBBBB.BBBBBBBB,DISP=OLD [/color]       OUTPUT
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu May 14, 2015 4:39 pm    Post subject: Reply to: Job Didn't fail
Reply with quote

It is not clear what you are expecting. You have specified the FILE STATUS clause. If you are not going to test this and cause an abend yourself, just remove it, recompile, rerun, and see if you get what is "expected".
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu May 14, 2015 5:19 pm    Post subject:
Reply with quote

Show the code where you are opening ATMFICOM.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Thu May 14, 2015 5:31 pm    Post subject:
Reply with quote

Is the CBLQDA LE run time option in effect? If so, then that would explain the behavior reported by the TS. In particular pay attention to the Usage notes:

Quote:
CBLQDA(ON) and have a misspelling in your JCL, Language Environment creates a temporary file, writes to it, and then z/OSĀ® deletes it. You receive a return code of 0, but no output.

http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ceea300/clcblqd.htm
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu May 14, 2015 6:10 pm    Post subject:
Reply with quote

Here is my open file code for output file:

Code:
OPEN OUTPUT ATMFICOM.                                   
IF W01-ATMFICOM-STATUS = '00' OR '97'                   
   CONTINUE                                             
ELSE                                                   
   DISPLAY '*------------------------------------*'     
   DISPLAY ' INVALID FILE STATUS WHILE OPENING THE '   
   DISPLAY ' INPUT ATMFICOM FILE IN PGM ATMBICOM   '   
   DISPLAY ' IN SECTION  : B-INITIALISE            '   
   DISPLAY ' FILE STATUS : ' W01-ATMFICOM-STATUS       
   DISPLAY '*------------------------------------*'     
   PERFORM Z999-ABEND                                   
END-IF.                                                 
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu May 14, 2015 6:19 pm    Post subject:
Reply with quote

Hi Don,
Where can I find CBLQDA option:
The below is the area where I am compiling via chageman and I am not sure how to make CBLQDA OFF.
Code:
      PACKAGE ID: ****002515      STATUS: DEV      INSTALL DATE: 20150530     
                                                                               
STAGED NAME:      ATMBICOM                                                     
LIBRARY TYPE:     SRC - Source Library - Batch                                 
DATASET NAME:     *******.***.STG.#002515.SRC                                 
                                                                               
LANGUAGE          ===> COB322    (Blank for list; applies to source code)     
COMPILE PROCEDURE ===> COB322    (Blank for list; ? for designated procedure) 
COMPILE PARMS     ===>                                                         
LINK EDIT PARMS   ===> AMODE(31)                                               
DB2 PRECOMPILE    ===> NO        (Y/N)   PRECOMPILE VARIABLES ===> NO   (Y/N) 
OTHER OPTIONS     ===> YES       (Y/N to display other options)               
                                                                               
JOB STATEMENT INFORMATION:                                                     
===> //****ICOM JOB (999X999,DS),****,CLASS=C,MSGCLASS=V,NOTIFY=****_________ 
===> //*_____________________________________________________________________ 
===> //*_____________________________________________________________________ 
===> /*JOBPARM SYSAFF=*______________________________________________________ 
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu May 14, 2015 6:25 pm    Post subject:
Reply with quote

Hi Bill,
I removed the file status and compiled and reran the job but the job still ran fine.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu May 14, 2015 6:33 pm    Post subject: Reply to: Job Didn't fail
Reply with quote

Don may have a very good shot.

Include this is your step:

Code:
//CEEOPTS  DD  *
   RPTOPTS(ON)


This will list the values of all the Language Environment options for your run.

Check the value of CBLQDA which is shown to you. If it is (ON), then use this:

Code:
//CEEOPTS  DD  *
   CBLQDA(OFF)
   RPTOPTS(ON)
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Thu May 14, 2015 6:35 pm    Post subject:
Reply with quote

CBLQDA is an LE option, not a Cobol compiler option. To see the list of options in use in your shop, ask your friendly systems programmer.

Or add the following to your JCL:

Code:
//OPTRPRT DD SYSOUT=*           
//CEEOPTS DD *                   
 RPTOPTS(ON),MSGFILE(OPTRPRT)   
/*                               
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu May 14, 2015 7:27 pm    Post subject:
Reply with quote

Hi,

I found CBLQDA is ON . Kindly see below:
LAST WHERE SET OPTION
Code:
-------------------------------------------------------------------------------
PARMLIB(CEEPRM02)                ABPERC(NONE)                                 
PARMLIB(CEEPRM02)                ABTERMENC(ABEND)                             
PARMLIB(CEEPRM02)              NOAIXBLD                                       
PARMLIB(CEEPRM02)                ALL31(OFF)                                   
PARMLIB(CEEPRM02)                ANYHEAP(16384,8192,ANYWHERE,FREE)             
PARMLIB(CEEPRM02)              NOAUTOTASK                                     
PARMLIB(CEEPRM02)                BELOWHEAP(8192,4096,FREE)                     
PARMLIB(CEEPRM02)                CBLOPTS(ON)                                   
PARMLIB(CEEPRM02)                CBLPSHPOP(OFF)                               
PARMLIB(CEEPRM02)                CBLQDA(ON)                                   
PARMLIB(CEEPRM02)                CEEDUMP(60,SYSOUT=*,FREE=END,SPIN=UNALLOC)   
PARMLIB(CEEPRM02)                CHECK(ON)                                     
PARMLIB(CEEPRM02)                COUNTRY(ZA)               



and after I gave
Code:
//CEEOPTS  DD  *   
   CBLQDA(OFF)     
   RPTOPTS(ON)     
/* 


The job abended which is expected but can't it be done something in COBOL program in code or handled inside COBOL code. I mean if I am checking file status then why it didn't picked 96?:

Code:
*------------------------------------*           
 INVALID FILE STATUS WHILE OPENING THE           
 INPUT ATMFICOM FILE IN PGM ATMBICOM             
 IN SECTION  : B-INITIALISE                     
 FILE STATUS : 96                               
*------------------------------------*       
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Thu May 14, 2015 7:32 pm    Post subject:
Reply with quote

Well, according to the 2002 Cobol Standard, the behavior that you see with CBLQDA(ON) is "correct". According to the Standard, a conforming program should not fail due in this situation, it should dynamically create a file.

CBLQDA(OFF) is the IBM supplied default, so someone at your shop must have chosen to override it. I suggest that you ask the systems programming team that is responsible for LE why they made that decision.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu May 14, 2015 8:21 pm    Post subject: Reply to: Job Didn't fail
Reply with quote

Yes, it's even earlier than the 2002 (now 2014) Standard, it goes back to the 85 Standard.

This is from the documentation for CBLQDA:

Code:
ON
    Specifies that COBOL QSAM dynamic allocation is permitted. ON conforms to the 1985 COBOL standard.


If your technical staff change the default, you may get countless program failures. Might be a good idea, because those programs can hardly be "working" if they are just losing particular outputs :-)
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Thu May 14, 2015 10:41 pm    Post subject:
Reply with quote

I first learned about this issue when I helped out a programmer who'd spent 2 days banging his head against the wall trying to figure out why his output file wasn't being populated. He had ruled out a misspelled ddname because he expected that it would have caused an obvious error. And it would have, a few weeks before, when the setting had been CBLQDA(OFF). Someone on the systems programming staff had recently switched it to ON during a maintenance activity.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Fri May 15, 2015 12:35 am    Post subject:
Reply with quote

Well this is something a dangerous thing and also I suffered a serious problem ten days before when I changed an existing program and the requirement was to add one more output file to the program. I did that part and in JCL I added the new output file but somehow I tampered the the existing output file in JCL. The job was implemented in production and for me the job ran fine as I checked my new output file and I checked the existing output file which had already previous data . After three days customer complained they were receiving same data from past three days and all the settlement are messed up. Then I found that there was a mistake in JCL but I couldn't understand why this happened as the job should have abended as per my basic JCL knowledge. Then it took 4 days to recover the data and get the things settled. One my colleague said may be I didn't check for file status in the COBOL program that's why it didn't fail. Then today I created a small program and gave the file status to check whether it abends or not and the result is in the previous posts. Will check with system guys for the default CBLQDA.
Thanks guys for clarifying the doubt.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Fri May 15, 2015 8:53 am    Post subject:
Reply with quote

Quote:
as the job should have abended as per my basic JCL knowledge.
I think this is the real issue. Your problem is not JCL, it is COBOL. For a utility, a missing DD statement will cause an ABEND or non-zero return code. However, as you have discovered, COBOL will -- in some cases -- run a program even if a file DD name is not found. The Enterprise COBOL Programming Guide makes clear that in such a case the allocated file persists only for the length of the run unit -- that is, when your batch job completes the file goes away (it is a temporary file only).

There are a few cases where I've used BPXWDYN and executed COBOL programs in batch with NO DD statements. This is not a common need, but the code can be written.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Promotion fail Nic Clouston DB2 3 Sat Dec 08, 2012 11:06 pm
No new posts What are the Possible reasons for PHA... mchanapa CICS 15 Tue Dec 06, 2011 12:30 pm
No new posts Wow....I didn't know that!!! prasadplease General Talk & Fun Stuff 9 Wed Dec 01, 2010 1:04 pm
No new posts COBOL PROGRAM FAIL with Return Code 0012 shrivatsa COBOL Programming 11 Wed Oct 06, 2010 10:41 am
No new posts Simple if statement - condition fail shankarm COBOL Programming 17 Thu Aug 12, 2010 2:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us