Powerhouse vs UNIX variables and assignments

Darren Reely darren.reely@latticesemi.com
Mon, 22 Sep 2003 10:54:15 -0700


Maybe I'm barking up the wrong tree, but...

Since you know $AB4 is set, have you tried;

    LET T_ABI_FILE_NAME = GETSYSTEMVAL("AB4") + "/NP000221.DAT"
    setsystemval("GENRIC",TRUNC(T_ABI_FILE_NAME))

Your setting a variable named GENERIC to $AB4/NP000221.DAT. I do not 
think $AB4 is being expanded. It is just plain text in this case. This 
would explain why the other options are working. They either use a full 
path, or the current working directory.

I experimented with these two variations at the Solaris prompt and found

setenv myvar '$AB4/adkfjsf'   <--- This does not expand $AB4.

setenv myvar "$AB4/adkfjsf"   <--- This does expand $AB4 to set the full 
path.

Hope this helps you somehow.

Darren


Goparaju, Vidyasagar wrote:

>Hi Everyone,
>
>Environment - Solaris/UNIX/Powerhouse 8.43.C/Oracle-9i.
>
>In the following example, I am running into issues when I create and try to
>write data into a sequential file in the specified directory using a UNIX
>variable. 
>
>If I specify the complete path or create the file in my home directory it is
>working fine.
>
>;   LET T_ABI_FILE_NAME = 'NP000221.DAT'  				  --
>Works fine
>
>;   LET T_ABI_FILE_NAME = '/db0/apps/RUNTIME/ALLDATA/NP000221.DAT'  --
>Works fine
>
>    LET T_ABI_FILE_NAME = "$AB4/NP000221.DAT"				  --
>Does not work ???
>
>    LET T_COMMAND_LINE = (TRUNC(T_GENRIC_NAME) + ' ' +
>TRUNC(T_ABI_FILE_NAME)) - A touch command to create the file
>    RUN COMMAND T_COMMAND_LINE
>;
>; Redirect Generic file
>;
>@IF UNIX
>    if not setsystemval("GENRIC",TRUNC(T_ABI_FILE_NAME))
>    then error "Error while setting GENRIC"
>
>    LET T_COMMAND_LINE = "chmod 777 " + TRUNC(T_ABI_FILE_NAME)
>    RUN COMMAND T_COMMAND_LINE
>@ELSE
>    LET T_COMMAND_LINE = (T_GENRIC_DEFINE + ' ' + TRUNC(T_ABI_FILE_NAME))
>    RUN COMMAND T_COMMAND_LINE
>@ENDIF
>
>$ echo $AB4
>/db0/apps/RUNTIME/ALLDATA
>
>-rwxrwxrwx   1 goparaju staff          0 Sep 22 11:56
>/db0/apps/RUNTIME/ALLDATA/NP000221.DAT
>
>When I assign $AB4/NP000221.DAT to GENRIC, the file is getting created in
>$AB4 (/db0/apps/RUNTIME/ALLDATA ), but I am getting error on PUT GENERIC
>(data access error GENRIC, no file name or directory exists).
>
>;   LET T_ABI_FILE_NAME = 'NP000221.DAT'
>--  Works fine
>
>;   LET T_ABI_FILE_NAME = '/db0/apps/RUNTIME/ALLDATA/NP000221.DAT'  --
>Works fine
>
>    LET T_ABI_FILE_NAME = "$AB4/NP000221.DAT"				  --
>Does not work ???
>
>I have verified that the values of UNIX variables are set properly for QUICK
>by putting INFO statements with GETSYSTEMVAL.
>
>Please help.
>
>Thanks 
>Sagar
>
>= = = = = = = = = = = = = = = = = = = = = = = = = = = =
>Mailing list: powerh-l@lists.swau.edu
>Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
>Unsubscribe: "unsubscribe <password>" in message body to powerh-l-request@lists.swau.edu
>http://lists.swau.edu/mailman/listinfo/powerh-l
>This list is closed, thus to post to the list you must be a subscriber.
>  
>