Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Static call problem in COBOL

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

New User


Joined: 16 Oct 2007
Posts: 11
Location: Chennai

PostPosted: Wed Nov 11, 2009 7:51 pm    Post subject: Static call problem in COBOL
Reply with quote

Dears,

Can anyone please help me to identify What is the issue here.

Main Cobol ---- Sub cobol --- Assembler (Getting time using TIME macro)

I am calling the sub cobol program through static call and from that sub cobol I am calling the assembler program also as static - then I am getting the time from assembler as 1 hour less than the local time.

If I am changing any one of this call as dynamic then I am getting the correct time from assembler.

Please help me to identify what is the problem in the first case?

Thanks,
Chipu
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Nov 11, 2009 8:03 pm    Post subject: Reply to: Static call problem in COBOL
Reply with quote

Is this BATCH or CICS?

Are you using non-reentrant program-storage within the sub-program or are you passing COBOL storage to the sub-program?

Are you corrupting R12 in the sub-program? Probably not, but I thought I'd ask.

Is the sub-program LE compliant?

Are you using the Time Macro SVC 11 (LINKAGE=SVC) or LINKAGE=SYSTEM (Cross-Memory Services)?

Bill
Back to top
View user's profile Send private message
chidambaram

New User


Joined: 16 Oct 2007
Posts: 11
Location: Chennai

PostPosted: Wed Nov 11, 2009 8:25 pm    Post subject: Reply to: Static call problem in COBOL
Reply with quote

Both the cobol programs are DC-Batch program.

This is the command used in assembler to get time.

TIME DEC,CLOCK,ZONE=LT,LINKAGE=SYSTEM,DATETYPE=YYYYMMDD
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Wed Nov 11, 2009 8:25 pm    Post subject: Reply to: Static call problem in COBOL
Reply with quote

maybe using a dynamic call uses a different assembler <thingy>

very low probability that a different calling method would change a result by exactly one hour

but given enough proof I am willing to change idea ( after having it tested myself ) icon_biggrin.gif

seem to me that the problem determination is a bit flaky
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Nov 11, 2009 8:49 pm    Post subject:
Reply with quote

It would be interesting to see if the difference is still there when using UTC instead of LT.
Back to top
View user's profile Send private message
chidambaram

New User


Joined: 16 Oct 2007
Posts: 11
Location: Chennai

PostPosted: Wed Nov 11, 2009 9:15 pm    Post subject:
Reply with quote

Dear,

If I am using UTC then I am getting one hour difference in both Static / Dynamic calls.

Thanks,
Chipu
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Nov 11, 2009 9:21 pm    Post subject:
Reply with quote

Now that is interesting -- and totally contrary to the concept of UTC which is supposed to be invariant. Which implies something in a program is doing something to the time to create the difference.
Back to top
View user's profile Send private message
chidambaram

New User


Joined: 16 Oct 2007
Posts: 11
Location: Chennai

PostPosted: Wed Nov 11, 2009 9:40 pm    Post subject:
Reply with quote

Thanks Robert.

But my question here is how the time is varying even though if I am using the same module for STATIC and DYNAMIC?

Is anything like assembler will support some calling method only?

Any guess where the Problem is exactly coming?

Thanks,
Chipu
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Nov 11, 2009 9:47 pm    Post subject: Reply to: Static call problem in COBOL
Reply with quote

Assuming that CLOCK is the 16-Byte area which gets populated with the time/date, bytes 01-08 format is X'HHMMSSTHMIJU0000', with bytes 07-08 always X'0000' and bytes 09-16 format as X'YYYYMMDD00000000'.

Also, define a 64-Byte (16-Word) savearea and issue a STAM R0,R15,SAVEAREA before invoking the Macro and issue a LAM R0,R15,SAVEAREA after control is returned from the Macro.

The z/OS manual says that the access-registers are modified by LINKAGE=SYSTEM, so they need to be saved and restored.

Are you certain that R15 is zero after the macro returns to the sub-program, regardless whether it's a static or dynamic call?

Bill
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Nov 11, 2009 11:48 pm    Post subject: Reply to: Static call problem in COBOL
Reply with quote

Would you be allowed by your management to post the entire sub-program, surrounded by the appropriate "code" and "/code" BBcodes? Shouldn't be too many lines.

You can return the untouched R15 (from the Macro) to the COBOL caller, who can then interrogate the COBOL SPECIAL-REGISTER RETURN-CODE.

At the end of your sub-program, use the RETURN Macro -

Code:

RETURN (14,12),RC=(15)   


Bill
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Wed Nov 11, 2009 11:53 pm    Post subject:
Reply with quote

My guess would be that the STATIC call is picking up a different module than the DYNAMIC call. I've seen it happen before. To investigate
1) Where are you INCLUDEing the module from ( SYSLIB ) for STATIC call?
2) Where is the module being loaded from for DYNAMIC call? Don't ASSUME it's the same library - check it out by looking for the module in the order of libraries allocated when the module is called dynamically. I'll bet that
a) the module is being loaded from different libraries, and that
b) the module being loaded for dynamic call is one with UTC coding.
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
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Having a problem FTP'ng to the MF pahiker All Other Mainframe Topics 2 Fri Nov 10, 2017 8:20 pm
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us