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

Good afternoon,

 

I am trying to run proc means on multiple datasets I have downloaded into SAS. I was able to run proc means on the first three data sets, but not for the last one. For some reason, the log is saying it does not exist. Here is the code:

libname libref 'C:\Users\bamfo\Downloads';
run;
	options nodate center orientation=landscape;
run;
/*#1*/
data demo_j;
	set libref.demo_j;
run;
proc means data = work.demo_j;
TITLE 'The Contents of the DEMO_J Data Set';
run;
data bpx_j;
	set libref.bpx_j;
run;
proc means data = work.bpx_j;
TITLE 'The Contents of the BPX_J Data Set';
run;
proc contents data = work.bpx_j;
run;
data bmx_j_ge2yrs;
	set libref.bmx_j_ge2yrs;
run;
proc means data = work.bmx_j_ge2yrs;
TITLE 'The Contents of the BMX_J_GE2YRS Data Set';
run;
proc contents data = work.bmx_j_ge2yrs;
run;
data bmx_j_It2yrs;
	set libref.bmx_j_It2yrs;
run;
proc means data = work.bmx_j_It2yrs;
TITLE 'The Contents of the BMX_J_IT2YRS Data Set';
run;

And here is the log:

Licensed to GEORGE WASHINGTON UNIVERSITY - SFA T&R, Site 70158136.
NOTE: This session is executing on the X64_10HOME platform.

 

NOTE: Analytical products:

SAS/STAT 15.1
SAS/ETS 15.1
SAS/IML 15.1
SAS/QC 15.1

NOTE: Additional host information:

X64_10HOME WIN 10.0.18362 Workstation

NOTE: SAS initialization used:
real time 3.75 seconds
cpu time 2.95 seconds

1 libname libref 'C:\Users\bamfo\Downloads';
NOTE: Libref LIBREF was successfully assigned as follows:
Engine: V9
Physical Name: C:\Users\bamfo\Downloads
2 run;
3 options nodate center orientation=landscape;
4 run;

5 data hw4.demo_j;

ERROR: Libref HW4 is not assigned.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.00 seconds

 

6 proc contents hw4.demo_j;
----------
22
201
NOTE: Writing HTML Body file: sashtml.htm
ERROR: There is not a default input data set (_LAST_ is _NULL_).
ERROR 22-322: Syntax error, expecting one of the following: ;, CENTILES, DATA, DETAILS, DIR, DIRECTORY, FMTLEN, LIB, MEMTYPE, MT, MTYPE,
NODETAILS, NODS, NOPRINT, ORDER, OUT, OUT2, SHORT, VARNUM.
ERROR 201-322: The option is not recognized and will be ignored.
7 run;

NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.85 seconds
cpu time 0.51 seconds

NOTE: The SAS System stopped processing this step because of errors.

NOTE: Data file LIBREF.DEMO_J.DATA is in a format that is native to another host, or the file encoding does not match the session encoding.
Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance.
8 data demo_j;
9 set libref.demo_j;
NOTE: Data file LIBREF.DEMO_J.DATA is in a format that is native to another host, or the file encoding does not match the session encoding.
Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance.

NOTE: There were 9254 observations read from the data set LIBREF.DEMO_J.
NOTE: The data set WORK.DEMO_J has 9254 observations and 46 variables.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.04 seconds


10 proc contents demo_j;
------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, CENTILES, DATA, DETAILS, DIR, DIRECTORY, FMTLEN, LIB, MEMTYPE, MT, MTYPE,
NODETAILS, NODS, NOPRINT, ORDER, OUT, OUT2, SHORT, VARNUM.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
11 run;

NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds

NOTE: The SAS System stopped processing this step because of errors.

12 data demo_j;
13 set libref.demo_j;
NOTE: Data file LIBREF.DEMO_J.DATA is in a format that is native to another host, or the file encoding does not match the session encoding.
Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance.
14 run;

NOTE: There were 9254 observations read from the data set LIBREF.DEMO_J.
NOTE: The data set WORK.DEMO_J has 9254 observations and 46 variables.
NOTE: DATA statement used (Total process time):
real time 0.05 seconds
cpu time 0.04 seconds


15 proc means data = work.demo_j;
16 run;

NOTE: There were 9254 observations read from the data set WORK.DEMO_J.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.22 seconds
cpu time 0.29 seconds


17 proc means data = work.demo_j;
18 TITLE 'The Contents of the DEMO_J Data Set';
19 run;

NOTE: There were 9254 observations read from the data set WORK.DEMO_J.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.15 seconds
cpu time 0.23 seconds


20 data bpx_j;
21 set libref.bpx_j;
NOTE: Data file LIBREF.BPX_J.DATA is in a format that is native to another host, or the file encoding does not match the session encoding.
Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance.
22 run;

NOTE: There were 8704 observations read from the data set LIBREF.BPX_J.
NOTE: The data set WORK.BPX_J has 8704 observations and 22 variables.
NOTE: DATA statement used (Total process time):
real time 0.10 seconds
cpu time 0.07 seconds


23 proc means data = work.bpx_j;
24 TITLE 'The Contents of the BPX_J Data Set';
25 run;

NOTE: There were 8704 observations read from the data set WORK.BPX_J.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.08 seconds
cpu time 0.10 seconds


26 proc contents data = work.bpx_j;
27 run;

NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.14 seconds
cpu time 0.06 seconds


28 data bmx_j_it2yrs;
29 set libref.bmx_j_it2yrs;
ERROR: File LIBREF.BMX_J_IT2YRS.DATA does not exist.
30 run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.BMX_J_IT2YRS may be incomplete. When this step was stopped there were 0 observations and 0 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds


31 proc means data = work.bmx_j_it2yrs;
32 TITLE 'The Contents of the BMX_J_IT2YRS Data Set';
33 run;

NOTE: No variables in data set WORK.BMX_J_IT2YRS.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


NOTE: Data file LIBREF.BMX_J_LT2YRS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance.
34 data bmx_j_it2yrs;
35 set libref.bmx_j_It2yrs;
ERROR: File LIBREF.BMX_J_IT2YRS.DATA does not exist.
36 run;

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


37 data bmx_j_ge2yrs;
38 set libref.bmx_j_ge2yrs;
NOTE: Data file LIBREF.BMX_J_GE2YRS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance.
39 run;

NOTE: There were 8153 observations read from the data set LIBREF.BMX_J_GE2YRS.
NOTE: The data set WORK.BMX_J_GE2YRS has 8153 observations and 19 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds


40 data bmx_j_ge2yrs;
41 set libref.bmx_j_ge2yrs;
NOTE: Data file LIBREF.BMX_J_GE2YRS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance.
42 run;

NOTE: There were 8153 observations read from the data set LIBREF.BMX_J_GE2YRS.
NOTE: The data set WORK.BMX_J_GE2YRS has 8153 observations and 19 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds


43 proc means data = work.bmx_j_ge2yrs;
44 TITLE 'The Contents of the BMX_J_GE2YRS Data Set';
45 run;

NOTE: There were 8153 observations read from the data set WORK.BMX_J_GE2YRS.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds


46 proc contents data = work.bmx_j_ge2yrs;
47 run;

NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds


48 data bmx_j_It2yrs;
49 set libref.bmx_j_It2yrs;
ERROR: File LIBREF.BMX_J_IT2YRS.DATA does not exist.
50 run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.BMX_J_IT2YRS may be incomplete. When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.BMX_J_IT2YRS 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


51 proc means data = work.bmx_j_It2yrs;
52 TITLE 'The Contents of the BMX_J_IT2YRS Data Set';
53 run;

NOTE: No variables in data set WORK.BMX_J_IT2YRS.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

Thanks for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Your log does not match the "code" that you show.

You have multiple errors such as:

5 data hw4.demo_j;

ERROR: Libref HW4 is not assigned.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):

So every step that attempts to use the library HW4 is an error.

Also you have repeated errors with proc contents:

10 proc contents demo_j;
------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, CENTILES, DATA, DETAILS, DIR, DIRECTORY, FMTLEN, LIB, MEMTYPE, MT, MTYPE,
NODETAILS, NODS, NOPRINT, ORDER, OUT, OUT2, SHORT, VARNUM.
ERROR 202-322: The option or parameter is not recognized and will be ignored.

If you copy from the log and paste into a code box opened on the forum with the </> icon the underscore characters appear under DEMO_J because that is not a valid option. You use DATA=DEMO_J to indicate which data set to run proc contents against.

 

And in your data set in the title is it IT (capital "it") or LT with a lower case L? You may have copied/ retyped something with the incorrect letter. Because you have another set with GE2yrs (which I assume is greater than or equal) then I suspect you intended LT2yrs (for Less than), but the name when I copy and paste from log gives me:

35 set libref.bmx_j_It2yrs;

which is an uppercase "i" not an L.

Fonts matter for some things. One, lower case L and upper case "i" can look a lot alike.

 

And if you program long enough you will spend some time finding the difference between O and 0, capitol o and zero, at some time.

 

 

 

View solution in original post

7 REPLIES 7
ashb
Obsidian | Level 7
Thanks for your help! You and one of the posters below helped me realize that I read the file name wrong when I rewrote the specified file name in all lowercase letters. Thanks!
CurtisMackWSIPP
Lapis Lazuli | Level 10

The first obvious question is, does that dataset exist?  Go to the C:\Users\bamfo\Downloads directory and look for the file.

The other thing I see is a bunch of errors at the top of the log for code you didn't submit.  Could that explain what's going on?

ashb
Obsidian | Level 7

I'm sorry, I accidentally copied all of the log instead of the pertinent parts. I realized what the error was, I read the data set name as LIBREF.BMX_J_IT2YRS instead of LIBREF.BMX_J_LT2YRS. Thanks for your help!

ballardw
Super User

Your log does not match the "code" that you show.

You have multiple errors such as:

5 data hw4.demo_j;

ERROR: Libref HW4 is not assigned.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):

So every step that attempts to use the library HW4 is an error.

Also you have repeated errors with proc contents:

10 proc contents demo_j;
------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, CENTILES, DATA, DETAILS, DIR, DIRECTORY, FMTLEN, LIB, MEMTYPE, MT, MTYPE,
NODETAILS, NODS, NOPRINT, ORDER, OUT, OUT2, SHORT, VARNUM.
ERROR 202-322: The option or parameter is not recognized and will be ignored.

If you copy from the log and paste into a code box opened on the forum with the </> icon the underscore characters appear under DEMO_J because that is not a valid option. You use DATA=DEMO_J to indicate which data set to run proc contents against.

 

And in your data set in the title is it IT (capital "it") or LT with a lower case L? You may have copied/ retyped something with the incorrect letter. Because you have another set with GE2yrs (which I assume is greater than or equal) then I suspect you intended LT2yrs (for Less than), but the name when I copy and paste from log gives me:

35 set libref.bmx_j_It2yrs;

which is an uppercase "i" not an L.

Fonts matter for some things. One, lower case L and upper case "i" can look a lot alike.

 

And if you program long enough you will spend some time finding the difference between O and 0, capitol o and zero, at some time.

 

 

 

ashb
Obsidian | Level 7

I just realized I read the file name wrong thanks to your help. I read it as an I instead of an L ( LIBREF.BMX_J_IT2YRS vs LIBREF.BMX_J_LT2YRS) I appreciate it!

ashb
Obsidian | Level 7
Thank you, I initially copied the whole log with all of the errors to you and that was not accurate. The data ran after I was able to review the discrepancy in the file name like you said. Thanks a lot!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 648 views
  • 3 likes
  • 4 in conversation