Help using Base SAS procedures

reading only a part an external file

Reply
Regular Contributor
Posts: 161

reading only a part an external file

I am working with a macro.
I have an output file and am trying to read only a section of that output(external file) but having difficulty.
My output file is a .dat and this is a Mplus output.
next, I am attempting to concatenating the result of each replication to a new file named RESULT.

The only part I need is the following section:
Information Criteria

Number of Free Parameters 26
Akaike (AIC) 905.829
Bayesian (BIC) 973.563
Sample-Size Adjusted BIC 891.449
(n* = (n + 2) / 24)
This is my codes (which does not work)
* read the Information Criteria from the output file ;
data temp;
retain readingflag 0;
length line $ 20;
infile "C:\&commandfile..out" scanover; **** modified ****;
if readingflag=0 then do;
input line $ 1-20;
if left(trim(line))="Information Criteria" then readingflag=1;
end;
if readingflag=1 then do;
input varname $ estimate;
if varname="(n* = (n + 2) / 24)" then do;
readingflag=0;
end;
end;
if readingflag=1;
run;
* concatenating the result of each replication ;
data result;
set temp;
run;
Super Contributor
Super Contributor
Posts: 3,174

Re: reading only a part an external file

Suggest you add the statement below to help with self-diagnosis:

PUTLOG _ALL_;

This will help determine if you have input your data record correctly or not.

Also, you can test your code with a data-sample (instream) by using the statement:

DATALINES;

RUN;


Scott Barry
SBBWorks, Inc.
Regular Contributor
Posts: 241

Re: reading only a part an external file

Something like this may help.



   /* extract model fit stats from text file */


   data one;


     infile cards missover;


     input;


     if not index(_infile_,"Information Criteria"then return;


     input ;


     input @"Number of Free Parameters " nparm;


     input @"Akaike (AIC) " aic;


     input @"Bayesian (BIC) " bic;


     input @"Sample-Size Adjusted BIC " abic;


     output;


   cards;


   ...


   run a model


   ...


   Information Criteria


 


   Number of Free Parameters 26


   Akaike (AIC) 905.829


   Bayesian (BIC) 973.563


   Sample-Size Adjusted BIC 891.449


   (n* = (n + 2) / 24)


   ...


   run another model


   ...


   Information Criteria


 


   Number of Free Parameters 25


   Akaike (AIC) 95.829


   Bayesian (BIC) 93.563


   Sample-Size Adjusted BIC 81.449


   (n* = (n + 2) / 24)


   ...


   ;


   run;


 


   /* check */


   proc print data=one;


   run;


   /* on lst


   Obs    nparm      aic        bic        abic


    1       26     905.829    973.563    891.449


    2       25      95.829     93.563     81.449


   */

Regular Contributor
Posts: 161

Re: reading only a part an external file

Thank you for your help. I ended up using a different code and it worked. Now I have a different question. Since this is a simulation study I need to stack the results of all simulated result into one file. I am having trouble doing so. Would you please take a look at my codes.
Thank you in advance
* creating an empty data set to store the result ;
data result;
run;
* read the Information Criteria from the output file ;
data temp;
infile "c:\&commandfile..out" truncover;
input test $21. @;
if test="Information Criteria" then do;
input /;
length I_C $30;
do until(I_C=' ');
input I_C &$30. value;
put i_c= value=;
if value ^= . then output;
end;
stop;
end;
keep I_C value;
run;

* concatenating the result of each replication ;
data result;
set result temp;
run;
/*transposing the data file*/
proc transpose data=temp out=CDM.response;
run;
Super Contributor
Super Contributor
Posts: 3,174

Re: reading only a part an external file

Suggest the OP identify a sample "input" and desired "output", with SAS variable names as a header -- then review the ID and also BY statements for PROC TRANSPOSE as as suggested approach -- also consider the SAS support http://support.sas.com/ website and the supplemental technical / conference reference material.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

proc transpose id by statement site:sas.com
Regular Contributor
Posts: 161

Re: reading only a part an external file

Hi Chang,

It worked. Now I have another question. This is part of a simulation study so I have about 100 output that needs to be appended. How can I append 100 outputs.
Thanks
Super Contributor
Super Contributor
Posts: 3,174

Re: reading only a part an external file

Do your "100 outputs" reside in SAS database files? If so, what is the naming convention used and what SAS version are you using?

For example, if all files are named with the same "prefix string", you can use a SET statement technique like below, for example to concatenate all files starting with "XXX" in libref :

SET .XXX: ;

If your files all reside outside of SAS in an external data source, you will need to consider a SAS macro language technique, possibly, which will also depend on the external file naming convention -- however it is possible to an INFILE with an external file prefix (or possibly use FILENAME with PIPES and get the directory/file information into SAS for processing each individual file.

Scott Barry
SBBWorks, Inc.
Regular Contributor
Posts: 161

Re: reading only a part an external file

the files that I am appending is temp_&seed, seed=100
after running the following codes there are 100 files named: temp_1, temp_2,.....temp_100.

I have to tell you I am very new to SAS or any coding, I have just started learning SAS 2 weeks ago, so you need to be very clear for me to understand. For example what does the ":" after libref.sasdata: mean?
thanks


this is my codes, the last section is the part that generates the temp_ files.
thank you

%macro simulation;
%let num_students=100;
%let num_skills=3;
%let num_item=%eval(2**&num_skills-1);
%let num_total=%eval(2**&num_skills);
%let num_reps=2;

%let mu1=0;
%let mu2=-1;
%let mu3=-1;
%let mu4=-1;
%let mu5=-1;
%let mu6=-1;
%let mu7=-1;
%let mu8=0;
%let datafile=dat&seed.;
%let commandfile=CDM_&seed.;
%let outputfile=OUT_&seed.;

%do seed=1 %to &num_reps;


/* ADDEDED:to create C directory(IN SAS_CDM) TO SAVE MY Q-Matrix file*/

LIBNAME sas_cdm "C:\SAS_CDM ";
data SAS_CDM.Q_Matrix;
RUN;

data SAS_CDM.Q_Matrix;
set all_skills2;
drop lambda1_1 lambda1_2 lambda1_3 lambda0 i;
run;

data nu1;
array nu_num{&num_total} nu_num1-nu_num&num_total;
array nu{&num_total} nu1-nu&num_total;
%do i=1 %to &num_total;
nu_num{&i}=exp(&μ&i);
%end;
nu_denom=sum(of nu_num1-nu_num&num_total);
%do j=1 %to &num_total;
nu{&j}=nu_num{&j}/nu_denom;
%end;
drop nu_denom nu_num1-nu_num&num_total;
run;

proc transpose data=nu1 out=nu2; run;

data nu;
set nu2(rename=(col1=nu));
combination=_n_;
drop _name_;
run;

data all_skills;
array skills{&num_skills} skills1-skills&num_skills;
do j=1 to 2;
do i=1 to &num_skills;
if j=1 then skills{i}=1;
else skills{i}=0;
if skills{j}=. then skills{j}=0;
end;
output;
end;
drop i j;
run;

proc means data=all_skills completetypes;
class skills1-skills&num_skills;
output out=all_skills1;
run;

data all_skills2;
set all_skills1;
array lambda1{&num_skills} lambda1_1-lambda1_&num_skills;
array skills{&num_skills} skills1-skills&num_skills;
num=%eval(&num_skills);
if _type_=(2**num)-1 and sum(of skills1-skills&num_skills) ne 0;

/*Lambda Intercept*/
lambda0=-(1.5**sum(of skills1-skills&num_skills));

/*Lambda Main Effect*/
do i=1 to &num_skills;
lambda1{i}=skills{i}*2;
end;

drop num _type_ _freq_;
run;

data all_skills3;
set all_skills2;
question=_n_;
run;

data all_skills4;
set all_skills3;
do combinations=1 to &num_total;
output;
end;
run;

data combinations1;
array attributes{&num_skills} attributes1-attributes&num_skills;
array skills{&num_skills} skills1-skills&num_skills;
set all_skills1(keep=skills1-skills&num_skills _type_);
num=%eval(&num_skills);
if _type_=(2**num)-1;
do i=1 to &num_skills;
attributes{i}=skills{i};
end;
drop skills1-skills&num_skills i _type_ num;
run;

data combinations;
set combinations1;
combinations=_n_;
run;
/*ADDED: To create the file in SAS_CDM folder as well*/
data sas_cdm.combinations;
set combinations1;
combinations=_n_;
run;
/*ADDED: To create the file in SAS_CDM folder as well*/
data sas_cdm.Class;
set combinations1;
combinations=_n_;
run;

*/ADDED: TO chaning the format of combination to ASCII file*/
libname sas_cdm 'c:\CDM';
data _NULL_;
set sas_cdm.combinations;
file "C:\SAS_CDM\class..dat";
put attributes1 attributes2 attributes3 combinations;
run;

proc sort data=sas_cdm.combinations; by combinations; run;
proc sort data=all_skills4; by combinations; run;

data all_data;
merge all_skills4 sas_cdm.class; /*cdm*/
array lambda1{&num_skills} lambda1_1-lambda1_&num_skills;
array sum_lam{&num_skills} sum_lam1-sum_lam&num_skills;
array skills{&num_skills} skills1-skills&num_skills;
array attributes{&num_skills} attributes1-attributes&num_skills;
by combinations;
do i=1 to &num_skills;
sum_lam{i}=lambda1{i}* attributes{i}*skills{i};
end;

logit=lambda0+sum(of sum_lam1-sum_lam&num_skills);
pi_ic=exp(logit)/(1+exp(logit));

run;

data simulated_students;
array nu_skill{&num_total} nu1-nu&num_total;
array cum_skill{&num_total} cum1-cum&num_total;
set nu1;
/*Find Cumulative Distribution*/
cum_skill{1}=nu_skill{1};
do i=2 to &num_total;
cum_skill{i}=cum_skill{i-1}+nu_skill{i};
end;
/*Simulate Students*/
do student_num=1 to &num_students;
rand_uni=ranuni(&seed);
combinations=1;
do j=1 to &num_item;
if cum_skill{j} end;
do question=1 to &num_item;
output;
end;
end;
run;

proc sort data=simulated_students; by combinations question; run;
proc sort data=all_data; by combinations question; run;

data simulated_data;
merge simulated_students(keep=student_num combinations question in=main) all_data(keep=question combinations attributes1-attributes&num_skills skills1-skills&num_skills pi_ic);
by combinations question;
if main;
x_ic=ranbin(&seed,1,pi_ic);
run;

/* ADDED: To change the format of Q-Matrix to ascii file*/
libname sas_cdm 'c:\sas_CDM';
data _NULL_;
set sas_cdm.Q_Matrix;
file "C:\sas_CDM\Q_Matrix..dat";
put skills1 skills2 skills3;
run;

/* ADDEDED THIS:to change the name to Class*/

data Class_membership;
set nu;
rename combination=Class;
RUN;

/* ADDED: To change the format of Class_membership to ascii file*/
libname sas_cdm 'c:\sas_CDM';
data _NULL_;
set Class_membership;
file "C:\sas_CDM\Class_membership..dat";
put nu class;
run;

/*continue coding*/
proc sort data=simulated_data; by student_num combinations;run;

proc transpose data=simulated_data(keep=student_num combinations question x_ic) out=sas_cdm.student&seed(drop=_name_) prefix=question;
id question;
by student_num combinations;
run;

*/ADDED: To change the format of SAS to ASCII file*/
/* ADDED: To Create all Data Files*/
libname sas_cdm 'c:\CDM';
data _NULL_;
set sas_cdm.student&seed;
file "C:\CDM\&datafile..dat";
put student_num Combinations question1 question2 question3 question4 question5 question6 question7;
run;

/*Create a command File for Mplus*/
data _null_;
file "c:\cdm\&commandfile..inp";
put "TITLE: CRUM with only main Effect";
put "DATA: FILE IS c:\CDM\&datafile..dat;"; **** modified ****;
put "VARIABLE: NAMES= STUDENT CLASS X1-X7;";
PUT "USEVARIABLE = x1-x7;";
PUT "CATEGORICAL = x1-x7;";
PUT "CLASSES = c(8);";

PUT "ANALYSIS:";
PUT "TYPE=MIXTURE; !estimates latent classes;";
PUT "STARTS=0; !turn off multiple random start feature (disabled anyway);";

put "MODEL:";
PUT '%OVERALL%';
PUT "[C#1] (m1); !latent variable mean for attribute pattern [0,0,0];";
PUT "[C#2] (m2); !latent variable mean for attribute pattern [0,0,1];";
PUT "[C#3] (m3); !latent variable mean for attribute pattern [0,1,0];";
PUT "[C#4] (m4); !latent variable mean for attribute pattern [0,1,1];";
PUT "[C#5] (m5); !latent variable mean for attribute pattern [1,0,0];";
PUT "[C#6] (m6); !latent variable mean for attribute pattern [1,0,1];";
PUT "[C#7] (m7); !latent variable mean for attribute pattern [1,1,0];";

put '%c#1% !for attribute pattern [0,0,0];';
put "[x1$1] (t1_1); !threshold for item 1 LCDM kernel 1";
put "[x2$1] (t2_1); !threshold for item 2 LCDM kernel 1";
put "[x3$1] (t3_1); !threshold for item 3 LCDM kernel 1";
put "[x4$1] (t4_1); !threshold for item 4 LCDM kernel 1";
put "[x5$1] (t5_1); !threshold for item 5 LCDM kernel 1";
put "[x6$1] (t6_1); !threshold for item 6 LCDM kernel 1";
put "[x7$1] (t7_1); !threshold for item 7 LCDM kernel 1";


put '%c#2% !for attribute pattern [0,0,1];';
put "[x1$1] (t1_1); !threshold for item 1 LCDM kernel 1";
put "[x2$1] (t2_1); !threshold for item 2 LCDM kernel 1";
put "[x3$1] (t3_2); !threshold for item 3 LCDM kernel 2";
put "[x4$1] (t4_1); !threshold for item 4 LCDM kernel 1";
put "[x5$1] (t5_2); !threshold for item 5 LCDM kernel 2";
put "[x6$1] (t6_2); !threshold for item 6 LCDM kernel 2";
put "[x7$1] (t7_2); !threshold for item 7 LCDM kernel 2";

put '%c#3% !for attribute pattern [0,1,0];';
put "[x1$1] (t1_1); !threshold for item 1 LCDM kernel 1";
put "[x2$1] (t2_2); !threshold for item 2 LCDM kernel 2";
put "[x3$1] (t3_1); !threshold for item 3 LCDM kernel 1";
put "[x4$1] (t4_2); !threshold for item 4 LCDM kernel 2";
put "[x5$1] (t5_1); !threshold for item 5 LCDM kernel 1";
put "[x6$1] (t6_3); !threshold for item 6 LCDM kernel 3";
put "[x7$1] (t7_3); !threshold for item 7 LCDM kernel 3";

put '%c#4% !for attribute pattern [0,1,1];';
put "[x1$1] (t1_1); !threshold for item 1 LCDM kernel 1";
put "[x2$1] (t2_2); !threshold for item 2 LCDM kernel 2";
put "[x3$1] (t3_2); !threshold for item 3 LCDM kernel 2";
put "[x4$1] (t4_2); !threshold for item 4 LCDM kernel 2";
put "[x5$1] (t5_2); !threshold for item 5 LCDM kernel 2";
put "[x6$1] (t6_4); !threshold for item 6 LCDM kernel 4";
put "[x7$1] (t7_4); !threshold for item 7 LCDM kernel 4";

put '%c#5% !for attribute pattern [1,0,0];';
put "[x1$1] (t1_2); !threshold for item 1 LCDM kernel 2";
put " [x2$1] (t2_1); !threshold for item 2 LCDM kernel 1";
put "[x3$1] (t3_1); !threshold for item 3 LCDM kernel 1";
put "[x4$1] (t4_3); !threshold for item 4 LCDM kernel 3";
put "[x5$1] (t5_3); !threshold for item 5 LCDM kernel 3";
put "[x6$1] (t6_1); !threshold for item 6 LCDM kernel 1";
put "[x7$1] (t7_5); !threshold for item 7 LCDM kernel 5";

put '%c#6% !for attribute pattern [1,0,1];';
put "[x1$1] (t1_2); !threshold for item 1 LCDM kernel 2";
put "[x2$1] (t2_1); !threshold for item 2 LCDM kernel 1";
put "[x3$1] (t3_2); !threshold for item 3 LCDM kernel 2";
put "[x4$1] (t4_3); !threshold for item 4 LCDM kernel 3";
put "[x5$1] (t5_4); !threshold for item 5 LCDM kernel 4";
put "[x6$1] (t6_2); !threshold for item 6 LCDM kernel 2";
put "[x7$1] (t7_6); !threshold for item 7 LCDM kernel 6";

put '%c#7% !for attribute pattern [1,1,0];';
put "[x1$1] (t1_2); !threshold for item 1 LCDM kernel 2";
put "[x2$1] (t2_2); !threshold for item 2 LCDM kernel 2";
put "[x3$1] (t3_1); !threshold for item 3 LCDM kernel 1";
put "[x4$1] (t4_4); !threshold for item 4 LCDM kernel 4";
put "[x5$1] (t5_3); !threshold for item 5 LCDM kernel 3";
put "[x6$1] (t6_3); !threshold for item 6 LCDM kernel 3";
put "[x7$1] (t7_7); !threshold for item 7 LCDM kernel 7";

put '%c#8% !for attribute pattern [1,1,1];';
put "[x1$1] (t1_2); !threshold for item 1 LCDM kernel 2";
put "[x2$1] (t2_2); !threshold for item 2 LCDM kernel 2";
put "[x3$1] (t3_2); !threshold for item 3 LCDM kernel 2";
put "[x4$1] (t4_4); !threshold for item 4 LCDM kernel 4";
put "[x5$1] (t5_4); !threshold for item 5 LCDM kernel 4";
put "[x6$1] (t6_4); !threshold for item 6 LCDM kernel 4";
put "[x7$1] (t7_8); !threshold for item 7 LCDM kernel 8";

Put "MODEL CONSTRAINT: !used to define LCDM parameters and constraints";
put "!NOTE: Mplus uses P(X=0) rather than P(X=1) so terms must be multiplied by -1";
put "!One attibute measured: 1 intercept; 1 main effect";
put "NEW(l1_0 l1_11); !define LCDM parameters present for item 1";
put "t1_1=-(l1_0); !set equal to intercept by LCDM kernel";
put "t1_2=-(l1_0+l1_11); !set equal to intercept plus main effect for attribute 1";
put "l1_11>0; !make sure main effect is positive (higher probability for mastering";

put "!ITEM 2:";
Put "!Q-matrix Entry [0 1 0]";
put "!One attibute measured: 1 intercept; 1 main effect";
put "NEW(l2_0 l2_12); !define LCDM parameters present for item 2";
put "t2_1=-(l2_0);";
put "t2_2=-(l2_0+l2_12);";
put "l2_12>0; !the order constraints necessary for the main effect";


put " !ITEM 3:";
put "!Q-matrix Entry [0 0 1];";
put "!One attibute measured: 1 intercept; 1 main effect";
put "NEW(l3_0 l3_13); !define LCDM parameters present for item 3";
put "t3_1=-(l3_0);";
put "t3_2=-(l3_0+l3_13);";
put "l3_13>0; !the order constraints necessary for the main effect";

put " !ITEM 4:";
put "!Q-matrix Entry [1 1 0]";
put "!two attibutes measured: 1 intercept; 2 main effects; 1 two-way interaction";

put "NEW(l4_0 l4_11 l4_12 ); !define LCDM parameters present for item 4";
put "t4_1=-(l4_0);";
put "t4_2=-(l4_0+l4_11);";
put "t4_3=-(l4_0+l4_12);";
put "t4_4=-(l4_0+l4_11+l4_12);";
put "l4_11>0; !the order constraints necessary for the main effects";
put "l4_12>0; ";

put "!ITEM 5:";
put "!Q-matrix Entry [1 0 1]";
put "!two attibutes measured: 1 intercept; 2 main effects; 1 two-way interaction";
put "NEW(l5_0 l5_11 l5_13); !define LCDM parameters present for item 5";
put "t5_1=-(l5_0);";
put "t5_2=-(l5_0+l5_11); ";
put "t5_3=-(l5_0+l5_13);";
put "t5_4=-(l5_0+l5_11+l5_13); ";
put "l5_11>0; !the order constraints necessary for the main effects";
put "l5_13>0;";

put "!ITEM 6:";
put "!Q-matrix Entry [0 1 1]";
put "!two attibutes measured: 1 intercept; 2 main effects; 1 two-way interaction ";
put "NEW(l6_0 l6_12 l6_13); !define LCDM parameters present for item 6";
put "t6_1=-(l6_0);";
put "t6_2=-(l6_0+l6_12);";
put "t6_3=-(l6_0+l6_13);";
put "t6_4=-(l6_0+l6_12+l6_13);";
put "l6_12>0;";
put "l6_13>0;";

put "!ITEM 7:";
put "!Q-matrix Entry [1 1 1]";
put "!two attibutes measured: 1 intercept; 3 main effects; 3 two-way interactions; 1 three-way";
put "NEW(l7_0 l7_11 l7_12 l7_13); !define LCDM parameters presen";
put "t7_1=-(l7_0);";
put "t7_2=-(l7_0+l7_13);";
put "t7_3=-(l7_0+l7_12);";
put "t7_4=-(l7_0+l7_12+l7_13);";
put "t7_5=-(l7_0+l7_11);";
put "t7_6=-(l7_0+l7_11+l7_13);";
put "t7_7=-(l7_0+l7_11+l7_12);";
put "t7_8=-(l7_0+l7_11+l7_12+l7_13);";
put "l7_11>0; !the order constraints necessa";
put "l7_12>0;";
put "l7_13>0;";

put "OUTPUT:";
put "TECH10; !request additional model fit statistics be reported";

put "SAVEDATA:";
put "FORMAT IS f10.5; !format for output file";
put "FILE IS c:\cdm\&outputfile..dat; !print attribute estimates for respondents in file list";
put "SAVE = CPROBABILITIES; !instruct Mplus to save posterior probabilities of class";
run;

* execute analysis with Mplus ;
x "cd C:\";
x "'C:\cdm\Mplus.exe' c:\cdm\&commandfile..inp";


LIBNAME cdm "C:\CDM ";
RUN;
* read the Information Criteria from the output file ;
data CDM.temp_&seed;
infile "c:\&commandfile..out" truncover;
input test $21. @;
if test="Information Criteria" then do;
input / / @40 num_fre_par
/ @40 akaike
/ @40 bayesian
/ @40 sam_siz_adj_bic ;
output;
stop;
end;
drop test;
run;
%end;
%mend;
%simulation;
Super User
Posts: 9,775

Re: reading only a part an external file

Hi.
If all of the dataset's name are to start with temp ,you can use colon to match all of dataset's name.
See the following code,Assuming all the datasets are in the 'c:\';

[pre]
libname lib 'c:\';
data all;
set lib.temp: ;
run;
[pre]

Ksharp
Regular Contributor
Posts: 161

Re: reading only a part an external file

Thank you Ksharp that was exactly what I was asking for.
Super Contributor
Super Contributor
Posts: 3,174

Re: reading only a part an external file

As stated in my prior post, the use of a SAS dataset prefix in a SET statement is SAS version specific, it being a new feature available only with SAS 9.2.

Scott Barry
SBBWorks, Inc. Message was edited by: sbb
Super User
Posts: 9,775

Re: reading only a part an external file

Hi.
I tested it . There is no problem.
[pre]
libname lib 'c:\';
data all;
set lib.makedata: ;
run;
libname lib clear;


1 libname lib 'c:\';
NOTE: Libref LIB was successfully assigned as follows:
Engine: V9
Physical Name: c:\
2 data all;
3 set lib.makedata: ;
4 run;

NOTE: There were 3 observations read from the data set LIB.MAKEDATA1.
NOTE: There were 3 observations read from the data set LIB.MAKEDATA2.
NOTE: There were 3 observations read from the data set LIB.MAKEDATA3.
NOTE: The data set WORK.ALL has 9 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.95 seconds
cpu time 0.04 seconds


5 libname lib clear;
NOTE: Libref LIB has been deassigned.
[/pre]


Ksharp
Regular Contributor
Posts: 161

Re: reading only a part an external file

Thank you
it workedSmiley Happy
Regular Contributor
Posts: 161

Re: reading only a part an external file

Hi,
I am using SAS 9.2. and the code does not run.

This is my code:

/*appending the files in Response file. Do this seperately*/
libname CDM 'c:\';
data all;
set cdm.temp_: ;
run;



and this is the error I am getting:

21 /*appending the files in Response file. Do this seperately*/
22 libname CDM 'c:\';
NOTE: Libref CDM was successfully assigned as follows:
Engine: V9
Physical Name: c:\
23 data all;
24 set cdm.temp_: ;
ERROR: The data set list (CDM.temp_Smiley Happy does not contain any members.
25 run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.ALL may be incomplete. When this step was stopped there were 0
observations and 0 variables.
WARNING: Data set WORK.ALL was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
Super Contributor
Super Contributor
Posts: 3,174

Re: reading only a part an external file

It's most likely that you have defined an incorrect SAS LIBNAME location - I would doubt that you have SAS datasets/members in your root directory of the C:\ drive.

Here is the key information from your SAS-generated log output:

ERROR: The data set list (CDM.temp_Smiley Happy does not contain any members.

To start, find a suitable SAS data library folder, then do a PROC CONTENTS (shown below) to confirm you are where you expect to find your input SAS files, as coded in your SET statement:

PROC CONTENTS DATA=._ALL_ NODS;
RUN;


Scott Barry
SBBWorks, Inc. Message was edited by: sbb
Ask a Question
Discussion stats
  • 14 replies
  • 199 views
  • 0 likes
  • 4 in conversation