Setting VMS logicals from Quick

Hamilton, Allison Allison.Hamilton@Cognos.COM
Fri, 12 Feb 1999 17:09:01 -0500


This should work - I've done it dozens of times using multiple run commands
in 6.x and 7.x (I've not worked much with this in 8.x yet).  However I've
never mixed it with a DCL IF.  You could try to use GETSYSTEMVAL inside
PowerHouse instead, and then set the logical accordingly.  You could use
SETSYSTEMVAL instead of using the RUN COMMAND as well.  You can specify the
table there. 
Allison Hamilton

> ----------
> From: 	Thomson, Martyn EDUC:EX[SMTP:martyn.thomson@gems1.gov.bc.ca]
> Sent: 	Friday, February 12, 1999 4:31 PM
> To: 	'POWERHOUSE Listserv'
> Subject: 	Setting VMS logicals from Quick
> 
> 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.
> 
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.