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

Using IBM utility CEE3DLY to invoke a delay in cobol program


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

New User


Joined: 19 Apr 2012
Posts: 8
Location: India

PostPosted: Sat Apr 21, 2012 10:53 pm
Reply with quote

What I am doing is converting a Assembler program which is using STIMER Macro to COBOL. So for this I need to put delay in my COBOL program too.

For this I am using CEE3DLY utility of IBM.
Calling CEE3DLY as : Call "CEE3DLY" USING WAIT-TIME.
WAIT-TIME is having the no of seconds passed through JCL and was defined in data division as "PIC S9(9) BINARY"

I have defined wait-time as binary because CEE3DLY utility expects input as full word binary in range from 0 to 3600

Problem I am facing:
Getting S0C4 when I am trying to call CEE3DLY"
Error is : "CEE3204S The system detected a protection exception (System Completion Code=0C4)"

Though this error is removed when i invoke cobol inbuilt function of date just before calling the CEE3DLY as shown below(for example):

MOVE FUNCTION CURRENT-DATE (9:8) TO CURR-TIME
Call "CEE3DLY" USING WAIT-TIME

In this case my program works successfully.
I am defining CURR-TIME as "01 CURR-TIME PIC 9(8)" and is not having any relation with the WAIT-TIME.

So I was wondering how is protection exception (S0C4) removed in later case.

Thanks in advance for the time spent on my doubt.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Sat Apr 21, 2012 11:19 pm
Reply with quote

Are you passing the WAIT-TIME (seconds) in the JCL (PARM=) as 4-Bytes Hex/Binary or are you Calling a sub-program which issues the CEE3DLY, passing the WAIT-TIME as 4-Bytes Binary in a Parameter (CALL USING)?

If you're passing the WAIT-TIME, pass it as DISPLAY-NUMERIC and then move it to an S9(09) BINARY (Fullword) in WORKING-STORAGE when the program gains control.

Please provide an example (in hex) of your passed WAIT-TIME value.

Also, I'm assuming this is a Batch program? Are you specifying DYNAM as your compile option? If so, then define a WS field "WS-CEE3DLY" as PIC X(08) with a values of "CEE3DLY" and use this in your CALL.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Apr 22, 2012 2:47 am
Reply with quote

Quote:
Calling CEE3DLY as : Call "CEE3DLY" USING WAIT-TIME.


maybe you just need to use the proper syntax

it is obvious why you are experiencing a soc4.
the reason you are not receiving the soc4 after a function call to current_date
is because some register contains a valid address.

fix your syntax.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Mon Apr 23, 2012 7:32 pm
Reply with quote

Good day to all!

Do you have AMODE(31) and DATA(31) in your compile options? If no, then do so and test again your first scenario.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Apr 23, 2012 8:59 pm
Reply with quote

Jose,

DBZ replied, pointing out that the 2nd-parm is missing, which is the 12-byte feedback-code and that's what's needed.

LE Callable routines can be CALLED from 31-Bit and 24-Bit callers without consequence.

Once the feedback-code field is added as the 2nd-parm, then all should be OK.
Back to top
View user's profile Send private message
Sumit Jindal

New User


Joined: 19 Apr 2012
Posts: 8
Location: India

PostPosted: Tue Apr 24, 2012 12:41 pm
Reply with quote

Thanks everyone for your replies.

What is was doing is just calling CEE3DLY only using one of the parameter (input seconds) as its mentioned in manuals that other parameter(feedback Code)is optional and that's the reason I was getting S0C4

So as suggested by DBZ and Bill O'Boyle to remove the S0C4 we can define a 12 byte feedback code in working storage and call the utility as:

CALL "CEE3DLY" USING wait-time, feedback-code

Also if we don't want to use Feedback code, we can call CEE3DLY as:

CALL "CEE3DLY" USING wait-time OMITTED.

In the above case feedback code will be omitted.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Apr 24, 2012 5:45 pm
Reply with quote

The first two-bytes of the feedback-code act as a "Return-Code" and informs the Caller of success (X'0000's) or failure (not X'0000's).

I think it's wise to always supply a feedback-code when calling all LE Callable Service routines, even though IBM may indicate that it's optional, because someday, they may change their minds and make it mandatory. icon_eek.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 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
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top