Operating System - OpenVMS
1753831 Members
8944 Online
108806 Solutions
New Discussion

Re: COBOL / OpenVMS Override System Date

 
SOLVED
Go to solution
John T. Farmer
Regular Advisor

Re: COBOL / OpenVMS Override System Date

John G.,

Linking my modified acc_date program directly, works ok, but now I am working on the FAKE_RTL approach. It has created a REAL_ copy and a FAKE_ copy fo the COBRTL_TV. Where and how to I put my couple of date routines (DCOB$ACC_DATE & DCOB$ACC_DATE_YYYY) into the FAKE_RTL assembly? I have tried linking the FAKE_COBRTL_TV and my objects into a new sharable, but not working from the main calling program. Still executing from the real COBRTL_TV image. I think I'm close, but need a little more direction.

Thanks,

John F.
John Gillings
Honored Contributor

Re: COBOL / OpenVMS Override System Date

John,

> It has created a REAL_ copy and a FAKE_
> copy fo the COBRTL_TV

You should be working with DEC$COBRTL, not the translated VAX COBRTL image.

FAKE_RTL creates a MACRO32 version of the target RTL. It will be called FAKE_DEC$COBRTL.MAR. By default all routines are replaced by a routine that logs the arguments to the call and vectors through to the corresponding routine in the real RTL. You need to find the routines you want to replace and insert your own code into FAKE_DEC$COBRTL.MAR to build your modified fake image.

If you don't want to implement your routines in MACRO32, you can call out to another routine. For example:

.CALL_ENTRY LABEL=DCOB$ACC_DATE, HOME_ARGS=TRUE, MAX_ARGS=6
CALLG (AP),G^YOUR_DCOB$ACC_DATE
RET

The disadvantage of using other languages is the RTL dependency tree can get complex and confusing. In particular you CANNOT use the language you're faking (for reasons which should be immediately apparent!).

Note there are several DEC$COBRTL routines you should consider hijacking if you want your RTL to be consistent. ACC_DATE, ACC_DAY, ACC_DAY_WEEK and maybe a few others.

It may be worth taking the default FAKE_DEC$COBRTL, turning on argument tracing and running one of your target programs to see what routines it actually calls. This should also help you understand how FAKE_RTL works (you may also want to read the OpenVMS Technical Journal article).

Here's how:

$ @FAKE_RTL ! Setup environment
$ @FAKE_RTL DEC$COBRTL ! create default fake RTL
$ DEFINE FAKE_DUMPARGS TRUE ! enable dumping
$ FAKE_DEC$COBRTL ! symbol to enable fake RTL
$ RUN yourprogram
$ TYPE/PAGE FAKE_ARGDUMP.LOG ! see what was called

Send me mail if you need more detailed advice (my name with at in the middle and dot com on the end).

Please let me know if you have any trouble, or you want to do this on Itanium. I've got a later version which handles 64 bit arguments.
A crucible of informative mistakes