Setting VMS logicals from Quick
Thomson, Martyn EDUC:EX
martyn.thomson@gems1.gov.bc.ca
Fri, 12 Feb 1999 13:31:48 -0800
Does anyone have experience of repeatedly setting a VMS logical using the
RUN COMMAND verb?
Here's the scenario -
A Quick screen uses a reference file TAB_SUBJ_AREA which is an RMS indexed
file, but on starting up the screen doesn't know which file it will be using
- it depends on the current month. There's a separate version of the file
for each year in directories [.DATA_1999], [.DATA_1998], etc., so the code
(in the INITIALIZE procedure) goes like this -
The year is of course a variable, I've hardcoded it here for simplicity.
LET T_COMMAND = &
"DEFINE/JOB TAB$SUBJ$AREA TSQ$DISK8:[DATA_1999]TAB_SUBJ_AREA.DAT"
RUN COMMAND T_COMMAND
Then test if the file exists, if not use the previous year's data -
LET T_COMMAND = '$ IF F$SEARCH(""TAB$SUBJ$AREA"") .EQS. """" THEN ' + &
"DEFINE/JOB TAB$SUBJ$AREA TSQ$DISK8:[DATA_1998"]TAB_SUBJ_AREA.DAT"
RUN COMMAND T_COMMAND
If the file exists in 1999 there's no problem, it works fine and the file is
accessed, but if it's in 1998 the logical isn't replaced!
I've mimicked the steps in DCL - works fine.
I've tried doing a run command "$DEASSIGN/JOB" between the DEFINEs and
that works, but the second DEFINE still doesn't work. This I know from
stepping through in debug and using "$show logical TAB$SUBJ$AREA"
I've tried using ASSIGN instead of DEFINE - you can see I'm grasping at
straws here.
Any ideas why redefining the logical doesn't work?
Any suggestions for an alternative strategy?
Although it works at the first attempt if the file exists, is it even a
valid technique to declare a file before it's specification is known? I
didn't write this program;-)
TIA,
Martyn Thomson
Ministry of Education,
B.C., Canada
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.