BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
rbettinger
Pyrite | Level 9

I am writing SAS/IML code and executing it but SAS/Studio does not display my results n the RESULTS window. For example,

here is a simple IML program that demonstrates my situation:

options nonotes source ;
proc iml ; 
reset storage=fuzzylib.fuzzylib ;

a = 1 : 11 ;
a[ 5 ] = . ;
b = dif( a )`  ; print b ;
c = dif( a, 1 )` ; print c ;
d = dif( a, 1, 1 )` ; print d ;
e = d <= 0 ; print e ;
quit ;

Nothing fancy. Here is what SAS/Studio says:

 
 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.81;
 16         %LET _CLIENTVERSION=3.81;
 17         %LET _CLIENTMODE=wip;
 18         %LET _SASSERVERNAME=%BQUOTE(SASApp);
 19         %LET _SASHOSTNAME=%BQUOTE(odaws01-usw2);
 20         %LET _SASPROGRAMFILEHOST=%BQUOTE(odaws01-usw2);
 21         %LET _CLIENTUSERID=%BQUOTE(rsbettinger);
 22         %LET _CLIENTUSERNAME=%BQUOTE(rsbettinger);
 23         %LET CLIENTMACHINE=%BQUOTE(POOL-173-79-61-141.WASHDC.FIOS.VERIZON.NET);
 24         %LET _CLIENTMACHINE=%BQUOTE(POOL-173-79-61-141.WASHDC.FIOS.VERIZON.NET);
 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(/home/rsbettinger/Fuzzy/program6.sas));
 
            ________________________________________________________________________________________________________________________
            49
 
 33         %LET _BASEURL = %BQUOTE(https://odamid-usw2.oda.sas.com/SASStudio/);
 34         %LET _EXECENV=SASStudio;
 35         DATA _NULL_;
 36         CALL
 36       ! SYMPUT("GRAPHINIT"
                             _
                             49
 36       ! ,"");
 37         CALL
 37       ! SYMPUT("GRAPHTERM"
                             _
                             49
 37       ! ,"");
 38         RC=TSLVL('SASXGOPT','N');
 39         _ERROR_=0;
 40         IF (RC^=' ') THEN DO;
 41         CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
                                  ___                                    ________________
                                  49                                     49
 42         CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
                                  ___                      ___________________________________
                                  49                       49
 43         END;
 44         RUN;
 45         DATA _NULL_;
 46         RC=SYSPROD("PRODNUM002"
                                  _
                                  49
 46       ! );
 47         IF (RC^=1) THEN DO;
 48         CALL
 48       ! SYMPUT("GRAPHINIT"
                             _
                             49
 48       ! ,"");
 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/rsbettinger);
 58         %LET _SASWSTEMP_=%BQUOTE(/home/rsbettinger/.sasstudio/.images/9885f2ea-97a9-4b13-9885-5040b0a51bb8);
 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: program6.sas')
 62       ! STYLE=Daisy OPTIONS(BITMAP_MODE='INLINE' OUTLINE='ON' SVG_MODE='INLINE'
 62       ! CSS_PREFIX='.ods_9885f2ea-97a9-4b13-9885-5040b0a51bb8' BODY_ID='div_9885f2ea-97a9-4b13-9885-5040b0a51bb8' );
 63         &GRAPHINIT;
 64         OPTIONS FIRSTOBS=1;
 65         OPTIONS OBS=MAX;
 66         OPTIONS DTRESET DATE NUMBER NOTES;
 67         OPTIONS NOTES STIMER SOURCE NOSYNTAXCHECK;
 68         
 69         options nonotes source ;
 70         proc iml ;
 71         
 72         a = 1 : 11 ;
 73         a[ 5 ] = . ;
 74         b = dif( a )`  ; print b ;
 75         c = dif( a, 1 )` ; print c ;
 76         d = dif( a, 1, 1 )` ; print d ;
 77         e = d <= 0 ; print e ;
 78         quit ;
 79         
 80         
 81         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 82         ODS HTML CLOSE;
 83         &GRAPHTERM; ;*';*";*/;RUN;QUIT;
 84         QUIT;RUN;
 85         ODS HTML5 (ID=WEB) CLOSE;
 86         
 87         FILENAME _GSFNAME;
 88         DATA _NULL_;
 89         RUN;
 90         OPTIONS NOTES STIMER SOURCE SYNTAXCHECK;
 91         

and I don't understand what happened. As the plaintive programmer's lament goes, "But it was running this morning!" And it was. Have I exceeded some hidden limitation? I logged out of the session completely and logged back in but there was no change in SAS/Studio's nonresponse.

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Your first OPTIONS statement should suppress the printing of all code up to line 69. The fact that this does not happen points to something which put your SAS session into an unrecoverable state. Think unbalanced quotes, incomplete macro definition (missing %MEND) or similar. Start a new session, and make sure before each code submission that it does not cause one of the above.

View solution in original post

6 REPLIES 6
Reeza
Super User

Reset your SAS session.

 

 82         ODS HTML CLOSE;
 83         &GRAPHTERM; ;*';*";*/;RUN;QUIT;
 84         QUIT;RUN;
 85         ODS HTML5 (ID=WEB) CLOSE;
 86         

Looks like the output is being closed for some reason. 

rbettinger
Pyrite | Level 9

Thank you, Reeza, for a quick response. My simple program worked, but a more complex program did not. Same nonresponse of Results. I will log out again and restart from scratch. Maybe all it takes is time?

Reeza
Super User
I notice you're using a few option statements, perhaps there's something in there affecting the output.
rbettinger
Pyrite | Level 9

I commented-out the "OPTIONS NONOTES SOURCE ;" code (see below)

***options nonotes source ;
proc iml ; 
a = { 1 2 3 , 4 5 6} ;
print a ;
print (a[,]);
quit ;

and got the same raspberry as before:

 NOTE: PROCEDURE IML used (Total process time):
       real time           1:31.63
       user cpu time       0.08 seconds
       system cpu time     0.02 seconds
       memory              12693.84k
       OS Memory           33448.00k
       Timestamp           03/02/2023 09:43:44 PM
       Step Count                        42  Switch Count  5
       Page Faults                       0
       Page Reclaims                     2581
       Page Swaps                        0
       Voluntary Context Switches        673
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           176
       
 
 
 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.81;
 16         %LET _CLIENTVERSION=3.81;
 17         %LET _CLIENTMODE=wip;
 18         %LET _SASSERVERNAME=%BQUOTE(SASApp);
 19         %LET _SASHOSTNAME=%BQUOTE(odaws03-usw2);
 20         %LET _SASPROGRAMFILEHOST=%BQUOTE(odaws03-usw2);
 21         %LET _CLIENTUSERID=%BQUOTE(rsbettinger);
 22         %LET _CLIENTUSERNAME=%BQUOTE(rsbettinger);
 23         %LET CLIENTMACHINE=%BQUOTE(POOL-173-79-61-141.WASHDC.FIOS.VERIZON.NET);
 24         %LET _CLIENTMACHINE=%BQUOTE(POOL-173-79-61-141.WASHDC.FIOS.VERIZON.NET);
 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(/home/rsbettinger/Fuzzy/program6.sas));
 33         %LET _BASEURL = %BQUOTE(https://odamid-usw2.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/rsbettinger);
 58         %LET _SASWSTEMP_=%BQUOTE(/home/rsbettinger/.sasstudio/.images/5a3e706e-6399-4c71-855f-eaecb18a0c2a);
 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: program6.sas')
 62       ! STYLE=Daisy OPTIONS(BITMAP_MODE='INLINE' OUTLINE='ON' SVG_MODE='INLINE'
 62       ! CSS_PREFIX='.ods_5a3e706e-6399-4c71-855f-eaecb18a0c2a' BODY_ID='div_5a3e706e-6399-4c71-855f-eaecb18a0c2a' );
 63         &GRAPHINIT;
 64         OPTIONS FIRSTOBS=1;
 65         OPTIONS OBS=MAX;
 66         OPTIONS DTRESET DATE NUMBER NOTES;
 67         OPTIONS NOTES STIMER SOURCE NOSYNTAXCHECK;
 68         
 69         ***options nonotes source ;
 70         proc iml ;
 71         a = { 1 2 3 , 4 5 6} ;
 72         print a ;
 73         print (a[,]);
 74         quit ;
 75         
 76         
 77         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 78         ODS HTML CLOSE;
 79         &GRAPHTERM; ;*';*";*/;RUN;QUIT;
 80         QUIT;RUN;
 81         ODS HTML5 (ID=WEB) CLOSE;
 82         
 83         FILENAME _GSFNAME;
 84         DATA _NULL_;
 85         RUN;
 86         OPTIONS NOTES STIMER SOURCE SYNTAXCHECK;
 87         

so I will let my account rest overnight. Perhaps the poor thing is tired after a day of active use. Thanks for your help, Reeza

Kurt_Bremser
Super User

Your first OPTIONS statement should suppress the printing of all code up to line 69. The fact that this does not happen points to something which put your SAS session into an unrecoverable state. Think unbalanced quotes, incomplete macro definition (missing %MEND) or similar. Start a new session, and make sure before each code submission that it does not cause one of the above.

rbettinger
Pyrite | Level 9
Thanks, Kurt! You hit the nail right on the head.Inserting a %MEND is what I needed to (sorry) mend my error :^|

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 6 replies
  • 1397 views
  • 3 likes
  • 3 in conversation