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

The dataset has 25 columns and 17,199 rows.

The CLASS variable r1surveyyear has 3 levels.

Reeza
Super User

What do you mean by this statement in your code:

 *no change for work.dt1, Assignment1 or work.Assignment1;

PROC MEANS will not change any of the above data sets. It will display output. If you're having issues with displayed output this is likely a part of that. 

 

If you start a new, clean session of SAS and run the following what do you get?

 

proc means data=sashelp.class mean;
class sex;
output out=want n = mean= /autoname;
ods output summary=want2;
 run;

title 'Version 1';
proc print data=want;
title 'Version 2';
proc print data=want2;
run;
ballardw
Super User

OP apparently posted a bit of log and then removed it.

 

Interestingly there was a bit of code just before problem with proc means that looked like

 172        
 173        *Exercise 1.1
 174        *Replicate mean and standard deviati

Previous code shown did not include the *Exercise 1.1 bit so I suspect we have an issue with nested comment where the Exercise comment was not properly closed.

gwwp
Obsidian | Level 7

The new logs I posted after adjusting the comments per your suggestion don't seem to be displaying in the thread here, but after I fixed them I am still not seeing anything in the results panel, and the error log still ends on the same truncated line.

 

My Code:

/*import data and create temp dataset work.Assignment1*/
PROC IMPORT DATAFILE='/home/u61857737/my_data.csv'
	DBMS=CSV
	replace
	OUT=Assignment1;
	GETNAMES=YES;
	
RUN;

/*assign data to dataset dt1*/
data dt1;
	set work.Assignment1;
	run;

/*Exercise 1.1*/
/*Replicate mean and standard deviation of age for parcipants in study years 
“1999-2004”, “2005-2010” and “2011-2014” in Table 1*/

proc means data=work.dt1 mean; /*no change for work.dt1, Assignment1 or work.Assignment1*/
	var age;	
run;

The 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.81;
 16         %LET _CLIENTVERSION=3.81;
 17         %LET _CLIENTMODE=wip;
 18         %LET _SASSERVERNAME=%BQUOTE(SASApp);
 19         %LET _SASHOSTNAME=%BQUOTE(odaws01-euw1);
 20         %LET _SASPROGRAMFILEHOST=%BQUOTE(odaws01-euw1);
 21         %LET _CLIENTUSERID=%BQUOTE(u61857737);
 22         %LET _CLIENTUSERNAME=%BQUOTE(u61857737);
 23         %LET CLIENTMACHINE=%BQUOTE(CPEE4BFFA89FC8F-CME4BFFA89FC8D.CPE.NET.CABLE.ROGERS.COM);
 24         %LET _CLIENTMACHINE=%BQUOTE(CPEE4BFFA89FC8F-CME4BFFA89FC8D.CPE.NET.CABLE.ROGERS.COM);
 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/u61857737/Assignment1.sas));
 33         %LET _BASEURL = %BQUOTE(https://odamid-euw1.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/u61857737);
 58         %LET _SASWSTEMP_=%BQUOTE(/home/u61857737/.sasstudio/.images/bf38490f-c8f1-45a6-a711-4bceb3f90ad1);
 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: Assignment1.sas')
 62       ! STYLE=Htmlblue OPTIONS(BITMAP_MODE='INLINE' OUTLINE='ON' SVG_MODE='INLINE'
 62       ! CSS_PREFIX='.ods_bf38490f-c8f1-45a6-a711-4bceb3f90ad1' BODY_ID='div_bf38490f-c8f1-45a6-a711-4bceb3f90ad1' );
 63         &GRAPHINIT;
 64         OPTIONS FIRSTOBS=1;
 65         OPTIONS OBS=MAX;
 66         OPTIONS DTRESET DATE NUMBER NOTES;
 67         OPTIONS NOTES STIMER SOURCE NOSYNTAXCHECK;
 68         
 69         /*import data and create temp dataset work.Assignment1*/
 70         PROC IMPORT DATAFILE='/home/u61857737/my_data.csv'
 71         DBMS=CSV
 72         replace
 73         OUT=Assignment1;
 74         GETNAMES=YES;
 75         
 76         RUN;
 
 NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to 
 WORK.PARMS.PARMS.SLIST.
 77          /**********************************************************************
 78          *   PRODUCT:   SAS
 79          *   VERSION:   9.4
 80          *   CREATOR:   External File Interface
 81          *   DATE:      20JUL22
 82          *   DESC:      Generated SAS Datastep Code
 83          *   TEMPLATE SOURCE:  (None Specified.)
 84          ***********************************************************************/
 85             data WORK.ASSIGNMENT1    ;
 86             %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
 87             infile '/home/u61857737/my_data.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;
 88                informat seqn best32. ;
 89                informat pulse best32. ;
 90                informat dm best32. ;
 91                informat smokingnow best32. ;
 92                informat totalchol best32. ;
 93                informat hdl best32. ;
 94                informat a1c best32. ;
 95                informat gender best32. ;
 96                informat age best32. ;
 97                informat race best32. ;
 98                informat educ best32. ;
 99                informat antihtn best32. ;
 100               informat insurance best32. ;
 101               informat bmi best32. ;
 102               informat preg best32. ;
 103               informat sbpmean best32. ;
 104               informat dbpmean best32. ;
 105               informat race2 best32. ;
 106               informat race3 best32. ;
 107               informat cvd best32. ;
 108               informat r1surveyyear best32. ;
 109               informat highered best32. ;
 110               informat povertycat2 best32. ;
 111               informat risk10pc best32. ;
 112               informat highriskpc best32. ;
 113               format seqn best12. ;
 114               format pulse best12. ;
 115               format dm best12. ;
 116               format smokingnow best12. ;
 117               format totalchol best12. ;
 118               format hdl best12. ;
 119               format a1c best12. ;
 120               format gender best12. ;
 121               format age best12. ;
 122               format race best12. ;
 123               format educ best12. ;
 124               format antihtn best12. ;
 125               format insurance best12. ;
 126               format bmi best12. ;
 127               format preg best12. ;
 128               format sbpmean best12. ;
 129               format dbpmean best12. ;
 130               format race2 best12. ;
 131               format race3 best12. ;
 132               format cvd best12. ;
 133               format r1surveyyear best12. ;
 134               format highered best12. ;
 135               format povertycat2 best12. ;
 136               format risk10pc best12. ;
 137               format highriskpc best12. ;
 138            input
 139                        seqn
 140                        pulse
 141                        dm
 142                        smokingnow
 143                        totalchol
 144                        hdl
 145                        a1c
 146                        gender
 147                        age
 148                        race
 149                        educ
 150                        antihtn
 151                        insurance
 152                        bmi
 153                        preg
 154                        sbpmean
 155                        dbpmean
 156                        race2
 157                        race3
 158                        cvd
 159                        r1surveyyear
 160                        highered
 161                        povertycat2
 162                        risk10pc
 163                        highriskpc
 164            ;
 165            if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
 166            run;
 
 NOTE: The infile '/home/u61857737/my_data.csv' is:
       Filename=/home/u61857737/my_data.csv,
       Owner Name=u61857737,Group Name=oda,
       Access Permission=-rw-r--r--,
       Last Modified=19Jul2022:20:28:31,
       File Size (bytes)=1414822
 
 NOTE: 17199 records were read from the infile '/home/u61857737/my_data.csv'.
       The minimum record length was 72.
       The maximum record length was 84.
 NOTE: The data set WORK.ASSIGNMENT1 has 17199 observations and 25 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       user cpu time       0.03 seconds
       system cpu time     0.00 seconds
       memory              10713.31k
       OS Memory           37920.00k
       Timestamp           07/20/2022 08:30:12 PM
       Step Count                        105  Switch Count  2
       Page Faults                       0
       Page Reclaims                     268
       Page Swaps                        0
       Voluntary Context Switches        11
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           6928
       
 
 17199 rows created in WORK.ASSIGNMENT1 from /home/u61857737/my_data.csv.
   
   
   
 NOTE: WORK.ASSIGNMENT1 data set was successfully created.
 NOTE: The data set WORK.ASSIGNMENT1 has 17199 observations and 25 variables.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.14 seconds
       user cpu time       0.11 seconds
       system cpu time     0.01 seconds
       memory              10713.31k
       OS Memory           38436.00k
       Timestamp           07/20/2022 08:30:12 PM
       Step Count                        105  Switch Count  10
       Page Faults                       0
       Page Reclaims                     5194
       Page Swaps                        0
       Voluntary Context Switches        83
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           6984
       
 
 167        
 168        /*assign data to dataset dt1*/
 169        data dt1;
 170        set work.Assignment1;
 171        run;
 
 NOTE: There were 17199 observations read from the data set WORK.ASSIGNMENT1.
 NOTE: The data set WORK.DT1 has 17199 observations and 25 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              3696.18k
       OS Memory           34224.00k
       Timestamp           07/20/2022 08:30:12 PM
       Step Count                        106  Switch Count  2
       Page Faults                       0
       Page Reclaims                     495
       Page Swaps                        0
       Voluntary Context Switches        12
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           6920
       
 
 172        
 173        /*Exercise 1.1*/
 174        /*Replicate mean and standard deviati
gwwp
Obsidian | Level 7

@ballardw I've posted two completed logs and both were removed by the forum as soon as I post them. Do you know a work-around?

ballardw
Super User

@gwwp wrote:

@ballardw I've posted two completed logs and both were removed by the forum as soon as I post them. Do you know a work-around?


From what I saw of the post that I saw and disappeared I can't actually say. However there may have been some characters that appear in the LOG that are "objectionable" to the forum software right at that comment and could be the cause of your problem.

 

That means a work-around that takes just a bit more work may be needed. First step would be to create an actual text file of the log contents. That might be as easy as open Notepad or similar (NOT Wordpad or Word or other program that may try to interpret odd codes), save the file to your local drive. Then on the forum use the "drag and drop" area to drop the text file, or use the browse document files link to add an attachment for that text file.

ballardw
Super User

If that is indeed your entire log then there appears to be something in your source code with issues.

 

Which version of SAS are you using? We might have a side effect of one of the server versions limiting the size of the text that can be copied from the log if you actually see more than appears in the posts. Which would mean exporting the Log from the window to a text file. But if you don't see more in the log then the submitted code is an issue and that may require an export to text .SAS program file and attach that file as well.

gwwp
Obsidian | Level 7

Could you explain what a clean session of SAS is and how to get it? I'm using SAS Studio. Yesterday I was able to produce output to the results tab, but that work was lost.

 

I want to display the output to results of proc means for my dataset. Regardless of whether I state is as data=dt1, data=work.dt1, data=Assignment1 or data=work.Assignment1, there is no output. My logs are posted in separate comments here.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 22 replies
  • 1823 views
  • 5 likes
  • 6 in conversation