BookmarkSubscribeRSS Feed
Nietzsche
Lapis Lazuli | Level 10

Hello all.

 

I'm trying to learn SAS Macro using SAS OnDemand. I ran some script with Macro in it and somehow it screwed up SAS studio setting.

 

Testing SAS Studio's ability to print

I ran some simple data step then PROC PRINT in a new program with this simple data step and proc print.

 

/* Create a simple dataset called 'employees' */
data employees;
    input EmpID $ Name $ Age Salary;
    datalines;
101 John 28 50000
102 Mary 32 60000
103 Lisa 25 48000
104 Mark 40 75000
;
run;

/* Print the dataset */
proc print data=employees;
run;

nothing printed, log

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 2          TITLE;
 3          FOOTNOTE;
 4          OPTIONS LOCALE=en_US DFLANG=LOCALE;
 5          DATA _NULL_;
 6          RUN;
 7          OPTIONS VALIDVARNAME=ANY;
 8          OPTIONS VALIDMEMNAME=EXTEND;
 9          FILENAME _HTMLOUT TEMP;
 10         FILENAME _GSFNAME TEMP;
 11         FILENAME _DATAOUT TEMP;
 12         %LET SYSCC=0;
 13         %LET _CLIENTAPP='SAS Studio';
 14         %LET _CLIENTAPPABREV=Studio;
 15         %LET _CLIENTAPPVERSION=3.82;
 16         %LET _CLIENTVERSION=3.82;
 17         %LET _CLIENTMODE=wip;
 18         %LET _SASSERVERNAME=%BQUOTE(SASApp);
 19         %LET _SASHOSTNAME=%BQUOTE(odaws02-apse1-2);
 20         %LET _SASPROGRAMFILEHOST=%BQUOTE(odaws02-apse1-2);
 21         %LET _CLIENTUSERID=%BQUOTE(u62043935);
 22         %LET _CLIENTUSERNAME=%BQUOTE(u62043935);
 23         %LET CLIENTMACHINE=%BQUOTE(193-119-92-193.TPGI.COM.AU);
 24         %LET _CLIENTMACHINE=%BQUOTE(193-119-92-193.TPGI.COM.AU);
 25         %let SASWORKLOCATION="%sysfunc(getoption(work))/";
 26         FILENAME _CWD '.';
 27         DATA _NULL_;
 28         CALL SYMPUT('_SASWORKINGDIR',PATHNAME('_CWD'));
 29         RUN;
 30         FILENAME _CWD;
 31         
 32         %LET _SASPROGRAMFILE = %NRQUOTE(%NRSTR(Program 1));
 33         %LET _BASEURL = %BQUOTE(https://odamid-apse1-2.oda.sas.com/SASStudio/);
 34         %LET _EXECENV=SASStudio;
 35         DATA _NULL_;
 36         CALL SYMPUT("GRAPHINIT","");
 37         CALL SYMPUT("GRAPHTERM","");
 38         RC=TSLVL('SASXGOPT','N');
 39         _ERROR_=0;
 40         IF (RC^=' ') THEN DO;
 41         CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
 42         CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
 43         END;
 44         RUN;
 45         DATA _NULL_;
 46         RC=SYSPROD("PRODNUM002");
 47         IF (RC^=1) THEN DO;
 48         CALL SYMPUT("GRAPHINIT","");
 49         CALL SYMPUT("GRAPHTERM","");
 50         END;
 51         RUN;
 52         %LET _DATAOUT_MIME_TYPE=;
 53         %LET _DATAOUT_NAME=;
 54         %LET _DATAOUT_TABLE=;
 55         %LET _DATAOUT_URL=;
 56         %SYMDEL _DATAOUT_MIME_TYPE _DATAOUT_NAME _DATAOUT_URL _DATAOUT_TABLE;
 57         %LET _SASWS_ = %BQUOTE(/home/u62043935);
 58         %LET _SASWSTEMP_=%BQUOTE(/home/u62043935/.sasstudio/.images/65f97d1d-cb72-40be-9079-d251263a2afa);
 59         ODS LISTING CLOSE;
 60         ODS AUTONAVIGATE OFF;
 61         ODS GRAPHICS ON;
 62         ODS HTML5 (ID=WEB) DEVICE=PNG GPATH="&_SASWSTEMP_" ENCODING=utf8  FILE=_HTMLOUT (TITLE='Results: Program 1')
 62       ! STYLE=Htmlblue OPTIONS(BITMAP_MODE='INLINE' OUTLINE='ON' SVG_MODE='INLINE'
 62       ! CSS_PREFIX='.ods_65f97d1d-cb72-40be-9079-d251263a2afa' BODY_ID='div_65f97d1d-cb72-40be-9079-d251263a2afa' );
 63         &GRAPHINIT;
 64         OPTIONS FIRSTOBS=1;
 65         OPTIONS OBS=MAX;
 66         OPTIONS DTRESET DATE NUMBER NOTES;
 67         OPTIONS NOTES STIMER SOURCE NOSYNTAXCHECK;
 68         
 69         /* Create a simple dataset called 'employees' */
 70         data employees;
 71             input EmpID $ Name $ Age Salary;
 72             datalines;
 73         101 John 28 50000
 74         102 Mary 32 60000
 75         103 Lisa 25 48000
 76         104 Mark 40 75000
 77         ;
 78         run;
 79         
 80         /* Print the dataset */
 81         proc print data=employees;
 82         run;
 83         
 84         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 85         ODS HTML CLOSE;
 86         &GRAPHTERM; ;*';*";*/;RUN;QUIT;
 87         QUIT;RUN;
 88         ODS HTML5 (ID=WEB) CLOSE;
 89         
 90         FILENAME _GSFNAME;
 91         DATA _NULL_;
 92         RUN;
 93         OPTIONS NOTES STIMER SOURCE SYNTAXCHECK;
 94         

 

 

Chatgpt help..

 

chatgpt says I need to put ods listing;

 

so I ran

 

ods listing;  /* turn listing output back on */

data employees;
    input EmpID $ Name $ Age Salary;
    datalines;
101 John 28 50000
102 Mary 32 60000
103 Lisa 25 48000
104 Mark 40 75000
;
run;

proc print data=employees;
    title "Employee Details";
run;

 

but this time I get log with errors in it

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 2          TITLE;
 NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.
 3          FOOTNOTE;
 4          OPTIONS LOCALE=en_US DFLANG=LOCALE;
 5          DATA _NULL_;
 6          RUN;
 7          OPTIONS VALIDVARNAME=ANY;
 8          OPTIONS VALIDMEMNAME=EXTEND;
 86         &GRAPHTERM; ;*';*";*/;RUN;QUIT;
                          _________________
                          49
 NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space 
              between a quoted string and the succeeding identifier is recommended.
 
 9          FILENAME _HTMLOUT TEMP;
 10         FILENAME _GSFNAME TEMP;
 11         FILENAME _DATAOUT TEMP;
 12         %LET SYSCC=0;
 13         %LET _CLIENTAPP='SAS Studio';
 14         %LET _CLIENTAPPABREV=Studio;
 15         %LET _CLIENTAPPVERSION=3.82;
 16         %LET _CLIENTVERSION=3.82;
 NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.
 17         %LET _CLIENTMODE=wip;
 18         %LET _SASSERVERNAME=%BQUOTE(SASApp);
 19         %LET _SASHOSTNAME=%BQUOTE(odaws02-apse1-2);
 20         %LET _SASPROGRAMFILEHOST=%BQUOTE(odaws02-apse1-2);
 21         %LET _CLIENTUSERID=%BQUOTE(u62043935);
 22         %LET _CLIENTUSERNAME=%BQUOTE(u62043935);
 23         %LET CLIENTMACHINE=%BQUOTE(193-119-92-193.TPGI.COM.AU);
 24         %LET _CLIENTMACHINE=%BQUOTE(193-119-92-193.TPGI.COM.AU);
 25         %let SASWORKLOCATION="%sysfunc(getoption(work))/";
 26         FILENAME _CWD '.'
                            _
                            49
 26       ! ;
 NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space 
              between a quoted string and the succeeding identifier is recommended.
 
 27         DATA _NULL_;
 28         CALL SYMPUT('_SASWORKINGDIR',PATHNAME('_CWD'));
                                       ____________
                                       49
 NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space 
              between a quoted string and the succeeding identifier is recommended.
 
 29         RUN;
 30         FILENAME _CWD;
 31         
 32         %LET _SASPROGRAMFILE = %NRQUOTE(%NRSTR(Program 1));
 33         %LET _BASEURL = %BQUOTE(https://odamid-apse1-2.oda.sas.com/SASStudio/);
 28         CALL SYMPUT('_SASWORKINGDIR',PATHNAME('_CWD'));
                                                       ____
                                                       49
 NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space 
              between a quoted string and the succeeding identifier is recommended.
 
 34         %LET _EXECENV=SASStudio;
 35         DATA _NULL_;
 36         CALL SYMPUT("GRAPHINIT","");
 37         CALL SYMPUT("GRAPHTERM","");
 38         RC=TSLVL('SASXGOPT','N');
 39         _ERROR_=0;
 40         IF (RC^=' ') THEN DO;
 41         CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
 42         CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
 43         END;
 44         RUN;
 45         DATA _NULL_;
 46         RC=SYSPROD("PRODNUM002");
 47         IF (RC^=1) THEN DO;
 NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.
 48         CALL SYMPUT("GRAPHINIT","");
 49         CALL SYMPUT("GRAPHTERM","");
 50         END;
 51         RUN;
 52         %LET _DATAOUT_MIME_TYPE=;
 53         %LET _DATAOUT_NAME=;
 54         %LET _DATAOUT_TABLE=;
 55         %LET _DATAOUT_URL=;
 56         %SYMDEL _DATAOUT_MIME_TYPE _DATAOUT_NAME _DATAOUT_URL _DATAOUT_TABLE;
 57         %LET _SASWS_ = %BQUOTE(/home/u62043935);
 40         IF (RC^=' ') THEN DO;
                      ___________
                      49
 NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space 
              between a quoted string and the succeeding identifier is recommended.
 
 58         %LET _SASWSTEMP_=%BQUOTE(/home/u62043935/.sasstudio/.images/b4070644-ab2c-450b-a12a-df7c317f381f);
 59         ODS LISTING CLOSE;
 60         ODS AUTONAVIGATE OFF;
 61         ODS GRAPHICS ON;
 62         ODS HTML5 (ID=WEB) DEVICE=PNG GPATH="&_SASWSTEMP_" ENCODING=utf8  FILE=_HTMLOUT (TITLE='Results: Program
 62       ! 1') STYLE=Htmlblue OPTIONS(BITMAP_MODE='INLINE' OUTLINE='ON' SVG_MODE='INLINE'
             _______________________________________      ___________  ____________
             49                                           49           49
 62       ! CSS_PREFIX='.ods_b4070644-ab2c-450b-a12a-df7c317f381f' BODY_ID='div_b4070644-ab2c-450b-a12a-df7c317f381f' );
 NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space 
              between a quoted string and the succeeding identifier is recommended.
 
 63         &GRAPHINIT;
 64         OPTIONS FIRSTOBS=1;
 65         OPTIONS OBS=MAX;
 NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.
 66         OPTIONS DTRESET DATE NUMBER NOTES;
 67         %put %bquote(NOTE: ODS statements in the SAS Studio environment may disable some output features.);
 68         OPTIONS NOTES STIMER SOURCE NOSYNTAXCHECK;
 69         
 70         ods listing;  /* turn listing output back on */
 71         
 72         data employees;
 73             input EmpID $ Name $ Age Salary;
 74             datalines;
 75         101 John 28 50000
 76         102 Mary 32 60000
 77         103 Lisa 25 48000
 78         104 Mark 40 75000
 79         ;
 80         run;
 81         
 82         proc print data=employees;
 83             title "Employee Details";
 84         run;
 85         
 86         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 87         ODS HTML CLOSE;
 88         &GRAPHTERM; ;*';*";*/;RUN;QUIT;
 89         QUIT;RUN;
 90         ODS HTML5 (ID=WEB) CLOSE;
 91         
 92         FILENAME _GSFNAME;
 93         DATA _NULL_;
 94         RUN;
 95         OPTIONS NOTES STIMER SOURCE SYNTAXCHECK;

 Any help would be appreciated.

Passed SAS Base Programming (2022 Dec)
Preparing for SAS Advanced Programming (2026)
2 REPLIES 2
Tom
Super User Tom
Super User

You have left the SAS session that SAS/Studio uses to actually RUN your code in a state where it is waiting for you to complete a statement or comment.

 

The fastest way to fix it is to restart the SAS session.   You can do it from the menu or you should be able to use the F9 function key.  There is no need to logout of SAS/Studio.

 

Note that will lose all of your WORK datasets.

ballardw
Super User

Where is the Macro related code that you ran? I don't see any.

 

If you are setting the NONOTES and NOSOURCE options then you will lose much of the diagnostic information needed to resolve issues that may be causing problems.

 

The note about the quoted string in the following indicates that somewhere prior you would likely have had a mismatched quote and the code parser isn't processing things as you think they are.  

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 2          TITLE;
 NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.

 

In addition to using options NOTES and SOURCE for debugging you may want to add the option MPRINT show the code actually generated by macros. If you are doing moderately complex macro variable manipulation then SYMBOLGEN is a good option to add and if there are issues with macro logic, i.e. %if that misbehave, add MLOGIC to the options before running macro code.

 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 268 views
  • 0 likes
  • 3 in conversation