Wait in COBOL
Select messages from
# through # FAQ
[/[Print]\]
Goto page 1, 2  Next  :| |:
MVSFORUMS.com -> Application Programming

#1: Wait in COBOL Author: complex PostPosted: Tue Mar 23, 2004 3:42 pm
    —
Is there any inbuilt COBOL or LE feature which can allow an application program to wait for a specified time ?

#2:  Author: kolusuLocation: San Jose PostPosted: Tue Mar 23, 2004 4:01 pm
    —
complex,
Cobol has a delay module named 'ILBOWAT0' which will delay the execuetion for specified period of time. The only problem is that it operates in 24 bit addressing mode. The wait-time is specified in terms of seconds. In the below example, the pgm sits for 45 secs.


Code:

CBL DATA(24)                                         
IDENTIFICATION DIVISION.                             
PROGRAM-ID.    DELAY                                 
DATE-COMPILED.                                       
ENVIRONMENT DIVISION.                               
DATA DIVISION.                                       
WORKING-STORAGE SECTION.                             
01 WAIT-MODULE  PIC  X(08)  VALUE 'ILBOWAT0'.       
01 WAIT-TIME    PIC  S9(8) COMP VALUE 0.             
PROCEDURE DIVISION.                                 
                                                     
    MOVE +45 TO WAIT-TIME.                           
                                                     
    CALL WAIT-MODULE USING WAIT-TIME.               
                                                     
    GOBACK.                                         


Hope this helps...

Cheers

Kolusu

#3:  Author: complex PostPosted: Tue Apr 06, 2004 10:27 am
    —
Thanks for the info Kolusu.

I have another question , this may sound a bit amateurish - but what would happen if i link the ILBOWAT0 module from a 31 bit module ?

#4:  Author: kolusuLocation: San Jose PostPosted: Tue Apr 06, 2004 10:45 am
    —
complex,

It just takes 2 secs to test out what happens with the wait-module is linked with 31 bit addressing mode.

If you link ILBOWAT0 with a 31 bit mode then the job will abend with u4038 with the following message:

Code:

IGZ0033S An attempt was made to pass a parameter address above 16 megabyte to AMODE(24) program ILBOWAT0. 

From compile unit DELAY at entry point DELAY at compile unit offset +000003F2 at entry offset +000003F2 at address 181213F2.                                               


However there are ways of making it run above the line.


Kolusu

#5:  Author: WHITE PostPosted: Fri Sep 03, 2004 10:28 pm
    —
kolusu wrote:
complex,

It just takes 2 secs to test out what happens with the wait-module is linked with 31 bit addressing mode.

If you link ILBOWAT0 with a 31 bit mode then the job will abend with u4038 with the following message:

Code:

IGZ0033S An attempt was made to pass a parameter address above 16 megabyte to AMODE(24) program ILBOWAT0. 

From compile unit DELAY at entry point DELAY at compile unit offset +000003F2 at entry offset +000003F2 at address 181213F2.                                               


However there are ways of making it run above the line.


Kolusu
Hi,
I assume this delay module is suppled along with the Cobol Compiler ILBOWAT0.
As you are aware that currrently Mainframe(Z/OS) operates on 64 bit addressing mode.
In that case will this work on Mainframe systems ?

Thanks
White.

#6:  Author: MikeBaker PostPosted: Sat Sep 04, 2004 3:02 pm
    —
ILBOWAT0 is not the name of any COBOL compiler. It is one of the modules supplied with the COBOL LE library. It can run on zOS just so long as it runs in 24 bit mode.

"zOS and 64 bit mode" does not mean that everything runs in 64 bit mode. There will still be plenty of things running in 24bit, others in 31bit, and other stuff will be stored above the 32 bit line.

#7:  Author: Crox PostPosted: Tue Sep 14, 2004 5:07 pm
    —
An easy way to keep one identifier under the line, you can define it EXTERNAL. That is what you can do with the field wait-time. To be sure not to get any conflict with an other program, define wait-time as <program-name>-wait-time.

#8:  Author: tattva PostPosted: Sun Jan 08, 2006 10:37 am
    —
Hi all,

Can any one provide some indepth info(like source code.. etc) about ILBOWAT0.

Just curious to know.

Thanks,
tattva

#9:  Author: kolusuLocation: San Jose PostPosted: Sun Jan 08, 2006 10:52 am
    —
Tattva,

ILBOWAT0 is a poorly documented(actually no Documentation) which is still a part of the LE run-time library. Why do you need the source code ?

Hope this helps...

Cheers

Kolusu

#10:  Author: THRIVIKRAM PostPosted: Sun May 07, 2006 12:35 am
    —
kOLUSU,
I got this error while using the DELAY progtam.
An attempt was made to initialize an AMODE24 application without usingthe ALL31(OFF) and STACK(,,BELOW)
run-time options.

As you said there are ways of overcoming this error.Can you please tell how to get rid of this.

#11: define the parm EXTERNAL in the WORKING-STORAGE to pass Author: Crox PostPosted: Fri Jan 29, 2016 1:59 am
    —
Most of the sites are using default intallation parms which means that EXTERNA defintions are below the 16M line. By defining your A-mode 24 adressing parm as EXTERNAL, it will go ok.

#12:  Author: Terry_HeinzeLocation: Richfield, MN, USA PostPosted: Fri Jan 29, 2016 9:21 am
    —
Ah ha -- a time traveler. Smile

#13:  Author: Mickeyd PostPosted: Fri Jan 29, 2016 10:04 am
    —
first question why are you trying to do this?? you may get fired from your job if they find out your holding up a resource in a batch job

#14:  Author: kolusuLocation: San Jose PostPosted: Fri Jan 29, 2016 11:15 am
    —
Mickeyd wrote:
first question why are you trying to do this?? you may get fired from your job if they find out your holding up a resource in a batch job


Mickeyd,

From my experience it is to check if there is a resource deadlock (update/delete from a db2 table) and you just want to wait a few seconds and then attempt to access the resource once again and check if the resource is available rather than abending on the first attempt. My previous shop had a limit of 3 attempts and eventually it would abend if they failed.

#15:  Author: William Collins PostPosted: Fri Jan 29, 2016 11:36 am
    —
I'm resisting the temptation to edit the topic title to 10-year wait in COBOL.

Welcome back, Crox.



MVSFORUMS.com -> Application Programming


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Goto page 1, 2  Next  :| |:
Page 1 of 2

Powered by phpBB © 2001, 2005 phpBB Group