Write and run SAS programs in your web browser

Hourly Rate Not Showing Up

Reply
Occasional Contributor
Posts: 7

Hourly Rate Not Showing Up

Hi, I'm working on computing two sample test (ttest), I'm VERY new to SAAS.

 

The code I entered below, is not reading or finding the hourlypay column.  What should I do?

 

Thank you for the support!

 

data HourlyPay;
infile '/folders/myfolders/ST513_pay_survey.txt';
input HourlyPay Gender$;
run;
proc print data=hourlyPay;
run;
proc ttest data=heights;
class Gender$;
var HourlyPay;
run;

 

Super User
Posts: 19,157

Re: Hourly Rate Not Showing Up

[ Edited ]

CristinaAl wrote:

Hi, I'm working on computing two sample test (ttest), I'm VERY new to SAAS.

 

The code I entered below, is not reading or finding the hourlypay column.  What should I do?

 

Thank you for the support!

 

data HourlyPay;
infile '/folders/myfolders/ST513_pay_survey.txt';
input HourlyPay Gender$;
run;
proc print data=hourlyPay;
run;
proc ttest data=heights;
class Gender$;
var HourlyPay;
run;

 


 

Your input statement needs to reflect the variables in the data set, in the order they appear.

Your dataset has 3 variables, two character one numeric. 

 

Your input statement has two variables listed and not in the same order as your text file.

 

Fix the INPUT statement.

Occasional Contributor
Posts: 7

Re: Hourly Rate Not Showing Up

Thank you! That makes sense!

Super User
Posts: 11,134

Re: Hourly Rate Not Showing Up

Your data contains three fields in apparently gender grade and pay

So when  you use

input HourlyPay Gender$; SAS has been told to read the first column as pay and the second as gender.

 

Try

input gender $ grade $ Hourlypay;

 

In the following code refere to gender only. The $ in the input says "read gender as a character varaible" it is not part of the actual variable name.

Occasional Contributor
Posts: 7

Re: Hourly Rate Not Showing Up

Balardw!!! THANK YOU!

 

This resolved my issue and it worked!

 

Have a great weekend!

Ask a Question
Discussion stats
  • 4 replies
  • 205 views
  • 0 likes
  • 3 in conversation