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

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.
1 ACCEPTED SOLUTION

Accepted Solutions
mohamed_zaki
Barite | Level 11
@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

1 REPLY 1
mohamed_zaki
Barite | Level 11
@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);

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1 reply
  • 1107 views
  • 0 likes
  • 2 in conversation