Hi! Could you help me with the problem below. Appreciate.
proc contents data='D:\Projetos\SAS_Oficial_Online\EPG1V2_EG\data\pg1v2_eg.sas';
run;
1 The SAS System segunda-feira, 21 de dezembro de 2020 21h05min00s
1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Program';
4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5 %LET _CLIENTPROJECTPATH='';
6 %LET _CLIENTPROJECTPATHHOST='';
7 %LET _CLIENTPROJECTNAME='';
8 %LET _SASPROGRAMFILE='';
9 %LET _SASPROGRAMFILEHOST='';
10
11 ODS _ALL_ CLOSE;
12 OPTIONS DEV=PNG;
13 GOPTIONS XPIXELS=0 YPIXELS=0;
14 FILENAME EGSR TEMP;
15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16 STYLE=HTMLBlue
17 STYLESHEET=(URL="file:///D:/aplicativos/SASHome/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css")
18 NOGTITLE
19 NOGFOOTNOTE
20 GPATH=&sasworklocation
21 ENCODING=UTF8
22 options(rolap="on")
23 ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24
25 GOPTIONS ACCESSIBLE;
26 proc contents data='D:\Projetos\SAS_Oficial_Online\EPG1V2_EG\data\pg1v2_eg.sas';
ERROR: Extension for physical file name "D:\Projetos\SAS_Oficial_Online\EPG1V2_EG\data\pg1v2_eg.sas" does not correspond to a valid
member type.
27 run;
NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: The SAS System stopped processing this step because of errors.
28
29 GOPTIONS NOACCESSIBLE;
30 %LET _CLIENTTASKLABEL=;
31 %LET _CLIENTPROCESSFLOWNAME=;
32 %LET _CLIENTPROJECTPATH=;
33 %LET _CLIENTPROJECTPATHHOST=;
34 %LET _CLIENTPROJECTNAME=;
35 %LET _SASPROGRAMFILE=;
36 %LET _SASPROGRAMFILEHOST=;
37
38 ;*';*";*/;quit;run;
39 ODS _ALL_ CLOSE;
40
41
42 QUIT; RUN;
43
I think this will fit you want to do.
%include 'D:\Projetos\SAS_Oficial_Online\EPG1V2_EG\data\pg1v2_eg.sas';
PROC CONTENTS works on SAS data sets.
26 proc contents data='D:\Projetos\SAS_Oficial_Online\EPG1V2_EG\data\pg1v2_eg.sas'; ERROR: Extension for physical file name "D:\Projetos\SAS_Oficial_Online\EPG1V2_EG\data\pg1v2_eg.sas" does not correspond to a valid member type.
You have data= and then a SAS program, not a SAS data set.
What are you trying to do?
@fpedrozam wrote:
I want to import and do some analysis
PROC CONTENTS does neither. Why are you using PROC CONTENTS? Import from where?
A file with extension .sas is a SAS program, it has code that you (or someone) has written. It cannot be Imported because it does not have data. You cannot do analysis on it, because it is not data.
In just about all versions of SAS that I know of, you use File->Open to open this file.
I think this will fit you want to do.
%include 'D:\Projetos\SAS_Oficial_Online\EPG1V2_EG\data\pg1v2_eg.sas';
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.