SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Curious4
Fluorite | Level 6

The log: "

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
Unable to sample external file, no data in first 5 records
"

 

Anyone know why this data is not importing correctly? note:  I have corrected the spelling error in the out statement already

 

libname dat_raw '/folders/myfolders/DATASETS/DAT';
data dat_raw.stress2; 

data stress2;
	set dat_raw.stress2;
	file '/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt';
	put name $ 1-20 resthr 22-24 maxhr 26-28 rechr 30-32 timemin 34-36 timesec 38-40
	 tolerance 42;
	proc print; run;
	
proc import datafile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt'
   DBMS=tab out=dat_raw.stress2 replace;
	proc print; run;
	
proc export data=dat_raw.stress2 DBMS=xls replace
	outfile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2.xls'; 
	proc print; run;
	
proc export data=dat_raw.stress2 DBMS=csv replace
	outfile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2.csv';
114        libname dat_raw '/folders/myfolders/DATASETS/DAT';
 NOTE: Libref DAT_RAW was successfully assigned as follows: 
       Engine:        V9 
       Physical Name: /folders/myfolders/DATASETS/DAT
 
 NOTE: There were 5 observations read from the data set WORK.NEW.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.05 seconds
       cpu time            0.04 seconds
       
 
 115        data dat_raw.stress2;
 116        
 
 NOTE: The data set DAT_RAW.STRESS2 has 1 observations and 0 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.04 seconds
       cpu time            0.02 seconds
       
 
 117        data stress2;
 118        set dat_raw.stress2;
 119        file '/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt';
 120        put name $ 1-20 resthr 22-24 maxhr 26-28 rechr 30-32 timemin 34-36 timesec 38-40
 121         tolerance 42;
 122        
 
 NOTE: Variable name is uninitialized.
 NOTE: Variable resthr is uninitialized.
 NOTE: Variable maxhr is uninitialized.
 NOTE: Variable rechr is uninitialized.
 NOTE: Variable timemin is uninitialized.
 NOTE: Variable timesec is uninitialized.
 NOTE: Variable tolerance is uninitialized.
 NOTE: The file '/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt' is:
       Filename=/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt,
       Owner Name=root,Group Name=vboxsf,
       Access Permission=-rwxrwx---,
       Last Modified=08Oct2020:12:18:51
 
 NOTE: 1 record was written to the file '/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt'.
       The minimum record length was 42.
       The maximum record length was 42.
 NOTE: There were 1 observations read from the data set DAT_RAW.STRESS2.
 NOTE: The data set WORK.STRESS2 has 1 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.01 seconds
       
 
 122      !  proc print; run;
 
 NOTE: There were 1 observations read from the data set WORK.STRESS2.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.02 seconds
       cpu time            0.02 seconds
       
 
 123        
 124        proc import datafile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt'
 125           DBMS=tab out=dat_raw.stress2 replace;
 126        
 
 NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to 
 WORK.PARMS.PARMS.SLIST.
 Unable to sample external file, no data in first 5 records.
 ERROR: Import unsuccessful.  See SAS Log for details.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.33 seconds
       cpu time            0.20 seconds
       
 
 
 126      !  proc print; run;
 
 NOTE: There were 1 observations read from the data set WORK.STRESS2.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.05 seconds
       cpu time            0.05 seconds
       
 
 127        
 128        proc export data=dat_raw.stress2 DBMS=xls replace
 129        outfile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2.xls';
 130        
 
 ERROR: File DAT_RAW.STRESS2.DATA does not exist.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE EXPORT used (Total process time):
       real time           0.08 seconds
       cpu time            0.02 seconds
       
 
 
 130      !  proc print; run;
 
 NOTE: There were 1 observations read from the data set WORK.STRESS2.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.05 seconds
       cpu time            0.06 seconds
       
 
 131        
 132        proc export data=dat_raw.stress2 DBMS=csv replace
 133        outfile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2.csv';
 134        /*
 135        data _NULL_;
 136        file '/folders/myfolders/DATASETS/DAT/dat_raw/stress2_1.txt';
 137        put name $ 1-20 resthr 22-24 maxhr 26-28 rechr 30-32 timemin 34-36 timesec 38-40
 138        tolerance 42;
 139        proc print;
 140        run;
 141        
 142        proc import datafile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2_1.txt'
 143           DBMS=tab out=_NULL replace;
 144        proc print; run;
 145        
 146        proc export data=stress2 DBMS=xls replace
 147        outfile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2_1.xls';
 148        proc print; run;
 149        
 150        proc export data=stress2 DBMS=csv replace
 151        outfile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2_1.txt';
 152        
 153        
 154        
 155        
 156        
 157        
 158        ods rtf
 159        file='/folders/myfolders/DATASETS/stress2_1.rtf';
 160        */
 161        
 162        
 163        
 164        
 165        
 166        
 167        
 168        
 169        
 170        
 171        
 172        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to 
 WORK.PARMS.PARMS.SLIST.
 ERROR: File DAT_RAW.STRESS2.DATA does not exist. 
 ERROR: Export unsuccessful.  See SAS Log for details.
 184        
29 REPLIES 29
PaigeMiller
Diamond | Level 26

Copy the LOG as text, paste it into the window that appears when you click on the </> icon. We need to see the ENTIRE log for these steps (and not for dozens of steps before this). Show us the LOG for these steps, including code as it appears in the log, along with all ERRORs, NOTEs and WARNINGs, for these steps, unedited. Do not show us screen captures of LOG or SAS code.

--
Paige Miller
Curious4
Fluorite | Level 6
Hello,

I have edited the post and included the log. thanks!
ballardw
Super User
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.

Often means that you have more than one SAS session open at one time. The the SASUSER.PARMS is used to maintain some of your user preferences or custom SAS settings.

 

More of concern is why are you reading the file with a data step and then overwriting it with a Proc import call?

The note: Unable to sample external file, no data in first 5 records

means that from what SAS is seeing your text file has nothing in it for the first 5 lines and Proc import is quitting because of no valid data.

There is not need to go to the headache of creating a PDF file, which is throwing an error when I try to read it. Copy the text and paste into a code box opened on the forum using the </> icon.

 

 

Curious4
Fluorite | Level 6

I was trying to create a fixed file stress2_1.txt from the permanent data set stress2, then to go on and open the file with the import function and to also export it as a xlx and a csv file.

Kurt_Bremser
Super User

As your first DATA statement very effectively destroyed the dataset ("1 observation and 0 variables"), you first need to recreate the dataset.

And remove that statement.

Reeza
Super User

@Curious4 wrote:

I was trying to create a fixed file stress2_1.txt from the permanent data set stress2, 


That part of your code is correct, except for the fact that the prior step destroyed the stress2 part and you did not export the variable names.

 


@Curious4 wrote:

open the file with the import function 


You cannot do that for a fixed width file. You need to write a data step to import data when it's been exported as fixed width file. If you exported it as tab or comma delimited then you could read it. In a fixed width file, records can be all squished together so the compiler cannot interpret where variables start and end with any certainty. When you import it, you should give it a unique name otherwise it replaces your old data set. Until you have it correctly coded, this isn't really what you want to do.

 


@Curious4 wrote:

 to also export it as a xlx and a csv file.


Your code for that is fine - try it based on a different data set or directly from the raw_data.stress2 data set.

 


@Curious4 wrote:

I was trying to create a fixed file stress2_1.txt from the permanent data set stress2, then to go on and open the file with the import function and to also export it as a xlx and a csv file.


 

Curious4
Fluorite | Level 6
I have updated the post again with the code blocks.
Reeza
Super User

The problem is partly your second line of code. This doesn't do anything and may have destroyed your input data set.

 

Your code is currently taking a data set, writing it out fixed width file and then tries to read it back in as tab delimited. Is that what you intended?

 

data dat_raw.stress2;

@Curious4 wrote:

The log: "

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
Unable to sample external file, no data in first 5 records
"

 

Anyone know why this data is not importing correctly? note:  I have corrected the spelling error in the out statement already.fKn6smG - Imgur.png




Curious4
Fluorite | Level 6
I was trying to create the permenant data set, stress2 from the folder dat_raw. with the proc import statement I am simply trying to print the results of the data set stress2.
Reeza
Super User
Don't re-use the same data set name multiple times and I'd very strongly advise you to add comments to explain to yourself what you think is happening. Note that your import also replaces the data set you already had since it writes out to the same data set name. Putting a comment about what each input/output is expected from each step helps you avoid logical errors like this.
Curious4
Fluorite | Level 6
Hello,

I created a new data set

data stress2_1;
proc import datafile='/folders/myfolders/DATASETS/DAT/dat_raw/stress2.txt'
DBMS=tab out=stress2_1 replace;
proc print; run;

stress2 still seems to be emptied.
Reeza
Super User
Fix one thing at a time. First confirm your original stress2 data still exists.
Run the following to do that:

proc contents data=data_raw.stress2;
run;

Second confirm your export works as expected. Go open the text file and see if has the headers and values expected.

You cannot export a file using a fixed width format and then try and read it in again using PROC IMPORT. You need to write a data step to read it in instead. That would be step 3.
Curious4
Fluorite | Level 6
I thought you said dat_raw.stress2 was deleting everything?
Reeza
Super User

@Curious4 wrote:
I thought you said dat_raw.stress2 was deleting everything?

I don't know what you're asking here. 
That is just a reference to a data set in your sentence above. 

 

I said that this line (note the DATA) may delete your original data set, which is why I'm asking you to confirm that it does exist before proceeding further.

 

data dat_raw.stress2;

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 29 replies
  • 17771 views
  • 0 likes
  • 6 in conversation