BookmarkSubscribeRSS Feed
deblee73
Calcite | Level 5

Hello.

 

Every time I run the first piece of code in any script I get the following error:  WARNING: No logical assign for filename _GSFNAME.  Then I run the same piece of code and it runs.  I even opened a blank tab and hit run and still got the error.  It must be a setting in VIYA that is incorrect.  

 

This is the log returned and the warning is at the end. 

 

Thanks,
Deb

 

 

1 %studio_hide_wrapper;
2 OPTIONS NOSYNTAXCHECK;
3 TITLE;
4 FOOTNOTE;
5 DATA _NULL_;
6 RUN;
7 OPTIONS VALIDVARNAME=ANY;
8 OPTIONS VALIDMEMNAME=EXTEND;
9 ODS _ALL_ CLOSE;
10
11 OPTIONS NOSYNTAXCHECK;
12 DATA _NULL_;
13 LENGTH RC 4;
14 %let TWORKLOC="%sysfunc(getoption(work))";
15 RC=DLGCDIR(&TWORKLOC);
16 RUN;
17 OPTIONS NOSYNTAXCHECK;
18 FILENAME _HTMLOUT TEMP;
19 FILENAME _LISTOUT TEMP;
20 FILENAME _GSFNAME TEMP;
21 FILENAME _DATAOUT TEMP;
22 %LET SYSCC=0;
23 %LET _CLIENTAPP = %NRQUOTE(%NRSTR(SAS Studio));
24 %LET _CLIENTAPPABBREV = %NRQUOTE(%NRSTR(Studio));
25 %LET _CLIENTAPPVERSION=5.2;
26 %LET _CLIENTVERSION=5.2;
27 %LET _SASSERVERNAME = %NRQUOTE(%NRSTR(****));
28 %LET _SASHOSTNAME = %NRQUOTE(%NRSTR(****));
29 %LET _SASPROGRAMFILEHOST = %NRQUOTE(%NRSTR(****));
30 %LET _CLIENTUSERID = %NRQUOTE(%NRSTR(****));
31 %LET _CLIENTUSERNAME = %NRQUOTE(%NRSTR(****
31 ! ));
32 %LET CLIENTMACHINE = %NRQUOTE(%NRSTR(****));
33 %LET _CLIENTMACHINE = %NRQUOTE(%NRSTR(****));
34 %LET _CLIENTMODE = %NRQUOTE(%NRSTR(viya));
35 %let SASWORKLOCATION="%sysfunc(getoption(work))/";
36 FILENAME _CWD &SASWORKLOCATION;
37 DATA _NULL_;
38 CALL SYMPUT('_SASWORKINGDIR',PATHNAME('_CWD'));
39 RUN;
40 FILENAME _CWD;
41 %LET _SASPROGRAMFILE = %NRQUOTE(%NRSTR());

42 %LET _BASEURL=%NRQUOTE(%NRSTR(****)); /*REMOVED OUR URL*/

43 %LET _EXECENV = %NRQUOTE(%NRSTR(SASStudio;));
44 DATA _NULL_;
45 LENGTH RC $255;
46 CALL SYMPUT("GRAPHINIT","");
47 CALL SYMPUT("GRAPHTERM","");
48 RC=TSLVL('SASXGOPT','N');
49 _ERROR_=0;
50 IF (RC^=' ') THEN DO;
51 CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
52 CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
53 END;
54 RUN;
55 DATA _NULL_;
56 LENGTH RC 4;
57 RC=SYSPROD("PRODNUM002");
58 IF (RC^=1) THEN DO;
59 CALL SYMPUT("GRAPHINIT","");
60 CALL SYMPUT("GRAPHTERM","");
61 END;
62 RUN;
63 %LET _DATAOUT_MIME_TYPE=;
64 %LET _DATAOUT_NAME=;
65 %LET _DATAOUT_TABLE=;
66 %LET _DATAOUT_URL=;
67 %SYMDEL _DATAOUT_MIME_TYPE _DATAOUT_NAME _DATAOUT_URL _DATAOUT_TABLE;
68 %LET _SASWS_ = %BQUOTE(%sysfunc(getoption(work)));
69 %LET _SASWSTEMP_ = %BQUOTE(%sysfunc(getoption(work)));
70
71 ODS LISTING CLOSE;
72 OPTIONS PRINTERPATH=PDF;
73 ODS AUTONAVIGATE OFF;
74 ODS GRAPHICS ON;
75 ODS HTML5 (ID=WEB) METATEXT='http-equiv="Content-Security-Policy" content="default-src ''none''; style-src ''unsafe-inline'';
75 ! img-src data: ;"' DEVICE=PNG GPATH="&_SASWSTEMP_" PATH="&_SASWSTEMP_" ENCODING=utf8 FILE=_HTMLOUT (TITLE='Results:Program
75 ! 1.sas') STYLE=Illuminate OPTIONS(BITMAP_MODE='INLINE' OUTLINE='ON' SVG_MODE='INLINE'
75 ! CSS_PREFIX='.ods_cb3b84c5-c798-44da-bfa9-cd82185d09c9' BODY_ID='div_cb3b84c5-c798-44da-bfa9-cd82185d09c9' );
76 ODS LISTING FILE=_LISTOUT;
77 &GRAPHINIT;
78 OPTIONS FIRSTOBS=1;
79 OPTIONS OBS=MAX;
80 OPTIONS DTRESET DATE NUMBER;
81 OPTIONS DEVICE=PNG;
82 %studio_restore_wrapper;
83
84
85 %studio_hide_wrapper;
86 ODS HTML CLOSE;
87 &GRAPHTERM; ;*';*";*/;RUN;QUIT;
88 QUIT;RUN;
89 ODS HTML5 (ID=WEB) CLOSE;
90
91 ODS LISTING CLOSE;
92 FILENAME _GSFNAME;
WARNING: No logical assign for filename _GSFNAME.
93 DATA _NULL_;
94 RUN;
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
95 %studio_restore_wrapper;
96
97
 

 

7 REPLIES 7
Kurt_Bremser
Super User

Log lines 5 and 6 contain code for a DATA step, but this step never executed (no messages). This means your previous submit had something unbalanced (unbalanced quotes, non-terminated comment, or a %MACRO without %MEND) which prevents code from executing. The "magic statement" in line 87 managed to reset this condition, and so the FILENAME in line 92 tries to clear a file reference which was never defined (log line 20 did not execute).

deblee73
Calcite | Level 5

Thank you for the quick reply.  How would I go about changing this code or getting rid of it all together since it is not a part of any my scripts?  I can hit run as soon as I launch VIYA on a blank page and this is what I get.   It's like it's programmed into SAS somewhere and executed before my first piece of scripted code runs.  I hope that makes sense.  

Tom
Super User Tom
Super User

If SAS/Studio for VIYA is like normal SAS/Studio then you should be able to change your preferences to NOT HIDE the code that SAS/Studio submits before and after your code.

deblee73
Calcite | Level 5

Thanks, Tom.  I changed the preferences like you suggested and it's still the same. I see the code in the log after I hit run but I don't know where that code is to fix it.  Visually, there was no code to run but this is what I get after hitting run on a blank page. 

 

deblee73_0-1723505660927.png

 

Tom
Super User Tom
Super User

Photographs of Text are not really that helpful.  Copy the actual text from the log.  Especially the lines numbered 1 to 80 that look to be the PRE code that SAS/studio generated for you.

Kurt_Bremser
Super User

The code you posted is NOT the cause of your problem. Earlier code (your code) with unbalanced quotes or similar caused this behavior.

The default pre and post code is necessary for SAS Studio to work as intended. Do not disable it.

Kurt_Bremser
Super User

If this issue only happens the first time you run code after starting SAS Studio, then you might have mis-defined startup code which runs when the workspace server connection is established.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Discussion stats
  • 7 replies
  • 1621 views
  • 0 likes
  • 3 in conversation