DATA Step, Macro, Functions and more

Trying to only print certain files from imported data error messages

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 18
Accepted Solution

Trying to only print certain files from imported data error messages

I am trying to print observations 131-179 in the data set but keep getting an error message.

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 proc print data=problem4a (firstobs=131 obs=48);
ERROR: FIRSTOBS option > OBS option - no data to read from file WORK.PROBLEM4A.
57 run;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
 
58
59 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 
the above error is what appears after putting the following code into sas.
 

FILENAME CSV "/folders/myfolders/homeworkdata/diamond.csv" TERMSTR=CRLF;



/** Import the CSV file. **/

PROC IMPORT DATAFILE=CSV
OUT=problem4a
DBMS=CSV
REPLACE;
guessingrows = 1000;
RUN;

/** Print the results. **/

PROC PRINT DATA=problem4a; RUN;

/** Unassign the file reference. **/

FILENAME CSV;

proc print data=problem4a (firstobs=131 obs=48);
run;
 
any help is greatly appreciated.

Accepted Solutions
Solution
‎01-28-2016 02:03 PM
Super Contributor
Posts: 490

Re: Trying to only print certain files from imported data error messages

MadQuidd wrote:

 

56 proc print data=problem4a (firstobs=131 obs=48);
ERROR: FIRSTOBS option > OBS option - no data to read from file WORK.PROBLEM4A.
 
 

The OBS value specifies the last observation that SAS processes in a data set. 

So in order to do what you want let it be like

proc print data=problem4a (firstobs=131 obs=179);

 

View solution in original post


All Replies
Solution
‎01-28-2016 02:03 PM
Super Contributor
Posts: 490

Re: Trying to only print certain files from imported data error messages

MadQuidd wrote:

 

56 proc print data=problem4a (firstobs=131 obs=48);
ERROR: FIRSTOBS option > OBS option - no data to read from file WORK.PROBLEM4A.
 
 

The OBS value specifies the last observation that SAS processes in a data set. 

So in order to do what you want let it be like

proc print data=problem4a (firstobs=131 obs=179);

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 164 views
  • 0 likes
  • 2 in conversation