IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is there any command in Cobol (Batch Program) to DELAY


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sravindra_s

New User


Joined: 29 Nov 2005
Posts: 8

PostPosted: Wed Jun 25, 2014 11:08 am
Reply with quote

Hi All,

I am writing a cobol Batch TCP/IP program . where in " need to be able to set a delay on the call so we can throttle the call e.g. 30 milliseconds between calls. "

Meaning If my input file is having 3 records.

The Cobol program will read the first record once Connection to Port is established. After that the same first record needs to be talking to the port after a delay of 30 milliseconds . This will happen 10 times for the first record.

Then it reads the second record , process is repeated again till end of file.

we are doing Load Testing .
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jun 25, 2014 11:39 am
Reply with quote

Language Environment Callable Service CEEDLYM.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Jun 25, 2014 7:31 pm
Reply with quote

Out of curiosity, why do you need the delay for a read operation? Are your reads timing out?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Thu Jun 26, 2014 10:03 am
Reply with quote

You can perform n times in between the read or calls and delay the execution
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jun 26, 2014 12:16 pm
Reply with quote

Unless the secret part of the requirement was "su** of up the entire CPU", no you don't. How would you even know how many TIMES is 30ms?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 26, 2014 6:08 pm
Reply with quote

If you think you need a delay in a batch program, the design is wrong -- period. Batch jobs are not supposed to need delays, and you could negatively impact your entire LPAR if you do so incorrectly. Redesign the process.
Back to top
View user's profile Send private message
sravindra_s

New User


Joined: 29 Nov 2005
Posts: 8

PostPosted: Mon Jun 30, 2014 2:36 pm
Reply with quote

Thanks for the reply for my earlier query.

Mean time I was trying to connect to a port . But I am getting Below error.

60 ETIMEDOUT Connect The connection timed out before it
was completed. Ensure the server application is available.

How to solve this!!!!. Tried with different Port Number as well.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jun 30, 2014 5:43 pm
Reply with quote

Quote:
Ensure the server application is available.


there is NO guarantee that a delay will solve the server application availability

errors due to unavailable application should be pursued thru a different path
( management, operations control, ..., ... )
not by tweaking the code
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Mon Jun 30, 2014 5:48 pm
Reply with quote

I know it can be confusing dealing with ports and connections at first.

The error message tells you something very important. It's telling you that your program tried to reach out and connect with some server that waits for connections. It tried for 60 seconds, then gave up.

So, you need to make sure that the connection you are trying to make is valid from the perspective of the running program. Remember, the program is running on the mainframe, and has to reach that server from THERE. Just because you can ping it or whatever from your desktop, does NOT mean that the mainframe can see it.

You can be dealing with an invalid address, a firewall, different IP stacks, etc. So you have to start trying to isolate each factor and make sure it's correct.

So, start with the TSO command line and try to ping that server. I would bet doughnut money that you'll find your issue right away. Not two dozen doughnuts, but you know, like a 3/$2 kind of deal.

If you CAN ping it from the mainframe. Then it probably means the port is unreachable. So if the port can be reached from say, your desktop, then it must be a firewall.

The process here is just like any other problem. You need to think about what is actually happening, then break that down into testable chunks. Then test each of those chunks in isolation.
Back to top
View user's profile Send private message
sravindra_s

New User


Joined: 29 Nov 2005
Posts: 8

PostPosted: Tue Jul 01, 2014 10:26 am
Reply with quote

Thanks for your replies.

I had not passed the IP address to Half word Binary working storage variables to call IBM provided Connect socket program.

After which I connection successful message.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Tue Jul 01, 2014 5:57 pm
Reply with quote

Great, now I have to send 2 donuts to India!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Wed Jul 02, 2014 11:33 pm
Reply with quote

Quote:
Great, now I have to send 2 donuts to India!
icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top