BookmarkSubscribeRSS Feed
MisterJenn
Fluorite | Level 6

I am trying to correct the code but I am unsure of what I am doing wrong. 

 

libname HwQuest3'\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Homework 5';
data bone2(drop=sex rename=(tempvar=sex));
set hw5.bone2;
tempvar2 = input(sex,1.);
run;
data bone5(drop=sex rename=(tempvar=sex));
set hw5.bone5;
tempvar5 = input(sex,1.);
run;
data bone;
set  bone1
	bone2(in=intanner2)
	bone3
	bone4(rename=(gender=sex) in=intanner4) 
	bone5;
if intanner1 = 1 then tanner=1;
if intanner2 = 1 then tanner=2;
if intanner3 = 1 then tanner=3;
if intanner4 = 1 then tanner=4;
if intanner5 = 1 then tanner=5;
age = (dov-dob)/365.25;
run; 
144  * Question 3;
145  libname HwQuest3'\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Homework 5';
NOTE: Libref HWQUEST3 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Homework 5

NOTE: PROCEDURE GLM used (Total process time):
      real time           0.10 seconds
      cpu time            0.09 seconds


146  data bone2(drop=sex rename=(tempvar=sex));
147  set hw5.bone2;
ERROR: File HW5.BONE2.DATA does not exist.
148  tempvar2 = input(sex,1.);
149  run;

NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
      148:18
WARNING: The variable tempvar in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.BONE2 may be incomplete.  When this step was stopped there were 0
         observations and 1 variables.
WARNING: Data set WORK.BONE2 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


150  data bone5(drop=sex rename=(tempvar=sex));
151  set hw5.bone5;
ERROR: File HW5.BONE5.DATA does not exist.
152  tempvar5 = input(sex,1.);
153  run;

NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
      152:18
WARNING: The variable tempvar in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.BONE5 may be incomplete.  When this step was stopped there were 0
         observations and 1 variables.
WARNING: Data set WORK.BONE5 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


154  data bone;
155  set  bone1
156      bone2(in=intanner2)
157      bone3
158      bone4(rename=(gender=sex) in=intanner4)
159      bone5;
ERROR: File WORK.BONE1.DATA does not exist.
ERROR: File WORK.BONE3.DATA does not exist.
ERROR: File WORK.BONE4.DATA does not exist.
160  if intanner1 = 1 then tanner=1;
161  if intanner2 = 1 then tanner=2;
162  if intanner3 = 1 then tanner=3;
163  if intanner4 = 1 then tanner=4;
164  if intanner5 = 1 then tanner=5;
165  age = (dov-dob)/365.25;
166  run;

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


1 REPLY 1
Quentin
Super User

When you have errors in your SAS log, the usual advice is to start your investigation by looking at the first error message.

 

The first error I see is:

ERROR: File HW5.BONE2.DATA does not exist.

You don't show the libname statement that creates the HW5 libref.  The libref exists, but SAS can't find a dataset named BONE2 in that library.

 

In your code you create a library named HwQuest3 which points to a folder named \Homework 5:

libname HwQuest3'\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Homework 5';

Maybe you intended to call this library hw5, i.e.:

libname  HW5 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Homework 5';