MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wait in COBOL
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
complex
Beginner


Joined: 15 Sep 2003
Posts: 8
Topics: 4

PostPosted: Tue Mar 23, 2004 3:42 pm    Post subject: Wait in COBOL Reply with quote

Is there any inbuilt COBOL or LE feature which can allow an application program to wait for a specified time ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Mar 23, 2004 4:01 pm    Post subject: Reply with quote

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
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
complex
Beginner


Joined: 15 Sep 2003
Posts: 8
Topics: 4

PostPosted: Tue Apr 06, 2004 10:27 am    Post subject: Reply with quote

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 ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 06, 2004 10:45 am    Post subject: Reply with quote

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
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
WHITE
Beginner


Joined: 03 Sep 2004
Posts: 8
Topics: 4

PostPosted: Fri Sep 03, 2004 10:28 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
MikeBaker
Beginner


Joined: 04 May 2004
Posts: 96
Topics: 9

PostPosted: Sat Sep 04, 2004 3:02 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Crox
Beginner


Joined: 29 May 2004
Posts: 52
Topics: 9

PostPosted: Tue Sep 14, 2004 5:07 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Sun Jan 08, 2006 10:37 am    Post subject: Reply with quote

Hi all,

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

Just curious to know.

Thanks,
tattva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Sun Jan 08, 2006 10:52 am    Post subject: Reply with quote

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
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
THRIVIKRAM
Beginner


Joined: 03 Oct 2005
Posts: 70
Topics: 34

PostPosted: Sun May 07, 2006 12:35 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Crox
Beginner


Joined: 29 May 2004
Posts: 52
Topics: 9

PostPosted: Fri Jan 29, 2016 1:59 am    Post subject: define the parm EXTERNAL in the WORKING-STORAGE to pass Reply with quote

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.
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Fri Jan 29, 2016 9:21 am    Post subject: Reply with quote

Ah ha -- a time traveler. Smile
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Mickeyd
Beginner


Joined: 02 Jan 2003
Posts: 27
Topics: 0

PostPosted: Fri Jan 29, 2016 10:04 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Jan 29, 2016 11:15 am    Post subject: Reply with quote

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.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Fri Jan 29, 2016 11:36 am    Post subject: Reply with quote

I'm resisting the temptation to edit the topic title to 10-year wait in COBOL.

Welcome back, Crox.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group