Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenVMS - System Calls

Status
Not open for further replies.

HughSamson

IS-IT--Management
Feb 25, 2002
31
Greetings all,

I'm attempting to use Cobol on OpenVMS (Alpha, 7.1-2), and am coming unstuck on a SYS$TRNLNM call. Any assistance would be muchly appreciated.
My main problem is with the string length of the logical name to be translated - if the string does not fill the PIC clause, it won't translate. Fine for one or two calls, I can fudge it. But being smart, I decided to build a library of common system call routines, this being one of them, but come unstuck with the above-mentioned length problem.
I've tried using INSPECT to get the char count, and pass that as an argument to the sub-program, but get myself totally lost somewhere along the line. I would prefer to be able to just do something simple so the rest of my guys can use it without brain-strain, and don't have to worry about remembering to define anything more that the logical name & table name.

E.G.

01 trnlnm-logical-name pic x(255) value spaces.
01 trnlnm-logical-table pic x (255) value spaces.
01 trnlnm-logical-result pic x (255) value spaces.
..
Move 'SYS$OUPUT' to trnlnm-logical-name.
Move 'LNM$PROCESS' to trnlnm-logical-table.
CALL 'trnlnm-subprog'
using
by reference trnlnm-logical-name trnlnm-table-name
giving
trnlnm-logical-result
...

Obviously this means some complexity with the library program to work-up the missing bits & pieces for SYS$TRNLNM.

Has anyone else been able to code a simple (!) solution?
 
Replying to my own post - but I found the answer, and it may help someone else down the track...

Make a call to 'SYS$TRIM' passing the logical name by reference, and receiving a 'trimmed' version of the name back, as well as the length of the trimmed name. Repeat this for the logical name table.

When calling 'SYS$TRNLNM', pass the values as follows (assuming ws-logical-*-length is the value returned by the call to 'SYS$TRIM', and ws-trnlnm-ignore-case & ws-trnlnm-items have been defined in working storage correctly);

CALL 'sys$trnlnm'
using
by reference ws-trnlnm-ignore-case
by reference ws-logical-table(1:ws-logical-table-length)
by reference ws-logical-name(1:ws-logical-name-length)
OMITTED
by reference ws-trnlnm-list
giving ws-return-status.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top