Operating System - OpenVMS
1753518 Members
4937 Online
108795 Solutions
New Discussion юеВ

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

 
SOLVED
Go to solution
Art Wiens
Respected Contributor

Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

I have rebuilt Datatrieve v7.3 on our new VMS v8.3 Alpha to include the BAS$EDIT function. Invoking the function gives:

$ dtr
DATATRIEVE V7.3
Digital Query and Report System
Type HELP for help
DTR> print fn$bas_edit(" abc ",255)

FN$BAS
EDIT

%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000021EF78F4, PC=0000000000000016, PS=00000000

On the current system it works properly:

$ dtr
DEC DATATRIEVE V7.2
Digital Query and Report System
Type HELP for help
DTR> print fn$bas_edit(" abc ",255)

FN$BAS
EDIT

ABC

The DTR function is copied from the working one:

$DTR$FUN_DEF FN$BAS_EDIT, BAS$EDIT, 3
$DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS
$DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE
$DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1
$DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 2
$DTR$FUN_END_DEF

The DTRBLD procedure completes successfully, the new executables are installed as on the old system.

Any help would be appreciated.

Cheers,
Art
9 REPLIES 9
Art Wiens
Respected Contributor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

Other RTL functions work eg:

$DTR$FUN_DEF FN$SCG_ASCII, LIB$ICHAR, 1
$DTR$FUN_HEADER HDR = <"Ascii"/"Value">
$DTR$FUN_EDIT_STRING ^\ZZ9\
$DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L
$DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1
$DTR$FUN_END_DEF

DTR> print FN$SCG_ASCII("a")

Ascii
Value

97

Art
Hein van den Heuvel
Honored Contributor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

Hello Art,

I've used BAS$EDIT ages ago, but not with DTR 7.3. Maybe I'll try.

Our friend Bart Lederman wrote an example for it which you can find for example here:
http://wwwvms.mppmu.mpg.de/vmssig/src/C/bas$edit.txt
The defintion Bart uses is a little more explicit. For example it mentions $DTR$FUN_NOOPTIMIZE

(I agree, you should never optimize FUN, Fun should be accepted and enjoyed as it comes :-)

Can you run with the debugger, set module to the share, set breakpoint on BAS$EDIT, verify the arguments on entry and exit?

fwiw,
Hein.



Art Wiens
Respected Contributor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

I guess you're suggesting I rebuild DTR with the /DEBUG switch on the LINK command(s)? It's not linked with DEBUG by default.

Art
Art Wiens
Respected Contributor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

I've linked DTR with /MAP and /DEBUG. I'm a little lost at this point as to how to go about setting the breakpoint to be when the BAS$EDIT function is called and what do I look at to see the variables on entry and exit as you say? The only "test" I know to produce this error is with the print statement in DTR ie. I have no access to a "program" that might be doing this.

Did I mention I'm not a programmer? ;-)

Cheers,
Art

ps. should you really have more than an optimal amount of fun? Isn't that how heart attacks happen? ;-)
Hein van den Heuvel
Honored Contributor
Solution

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO


I talked to Art.
He also upgraded BASIC from 1.3 to 1.6 when upgrading DTR.

With that BAS$EDIT becomes DBASIC$EDIT
This should be resolved in DEC$BASRTL.EXE

So I recommend moving forward replacing all BAS$xxxxx funtions used by the corresponding DBASIC$ in DTRFND.MAR.
Compile, replact in DTRFUN.OLB
Cleans the DTRBLD.COM from BASRTL*_TV references and add the line
cluster=basrtl,,,sys$common:[syslib]dec$basrtl.exe/shareable
Put that right after FDVSHR.
That's where I put it in a test, and it worked.

Rebuid

Note: I reduced DTRBLD.COM to just the DTRSHR link command, with output to a private directory at first.

Define a logical to a bad name and see $DATA fail, just to be sure.
Then define to the new executable and try it!

Good Luck!
Hein.
Art Wiens
Respected Contributor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

As usual, there's a good reason this man has a wreath on his head!!

After we got off the phone, I had to go out but of course thought about this all the while and it all came back to me. Back in June of last year when I was doing all this setup (yes we're moving at a glacial pace here!) I was getting undefined symbols during the DTRBLD procedure referencing the BAS$xxx functions. eg:

%LINK-W-USEUNDEF, undefined symbol BAS$EDIT referenced
in psect $LINKAGE offset %X00000100
in module DTRFND file SYS$COMMON:[DTR]DTRFUN.OLB;1

I hacked around and found they were in the BASRTL_D56_TV.EXE and I looked at the difference between the new DTRBLD.COM and the existing one - it had the references to the TV images - and put two and two together - viola - no more undefined symbols!

It was only this past week that the application folks started testing things in earnest and found these couple of functions didn't work.

So I did as you directed - removing the BASRTL TV image specifications and using the current DEC$BASRTL file where suggested and changed the references to DBASIC$ from BAS$ of course it all works as expected.

DTR> print fn$bas_date("39074")

FN$BAS
DATE

15-Mar-09

WooHoo!

Hein reply again, you deserve at least an additional 10 points!

Thank you so much for your help!!

Oh and by the way, all those "weak references" are gone from the build now too! The only complaints left are three:

%LINK-W-TIRLNGTH, object command data record length illegal (0.)
record 1 in module EXT_LEVEL_FORM file SYS$COMMON:[DTR]DTRLIB.OLB;2


Cheers,
Art
Hal Kuff
Occasional Advisor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

Art, do you have a canned e-mail with the steps and code and proceedure to implement this as a function to wack spaces in a field.. so as to avoid those nastry illegal ascii value issues?
Art Wiens
Respected Contributor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

Did I mention I'm not a programmer? ;-) But the "magic" seems to be achieved in the EDIT$ function in Basic ... have a look at:

http://h71000.www7.hp.com/doc/82final/5433/5433pro_010.html#tide

Cheers,
Art
Hoff
Honored Contributor

Re: Datatrieve w/ BASIC RTL extensions - SYSTEM-F-ACCVIO

Google should turn up some bas$edit calls around the net; it's an old-time path into some BASIC RTL routines that were never really available in the base operating system. There's a C example and a text file here:

http://wwwvms.mppmu.mpg.de/vmssig/src/C/

To see what BAS$EDIT can do (and what you'll need to pass in), see the EDIT mechanism over in the BASIC documentation.

http://h71000.www7.hp.com/doc/82final/5433/5433pro_010.html#tide

Depending on what you're up to with the character set encoding, the OpenVMS RTL routine lib$movtc can be used here, too. And C has various routines that are on-point here, too, the older isprint and isspace and other such pieces and the "newer" iconv pieces.

If you're working with old-style ASCII, this stuff is (usually) easy via BAS$EDIT or lib$movtc or such. If you're using newer character sets and newer encoding, this can get somewhat more slippery.

If you're locked onto OpenVMS, then there is another (archived, obsolete, obscure) option:

http://h71000.www7.hp.com/doc/73final/documentation/pdf/OVMS_NCS_UTIL.pdf