Help using Base SAS procedures

Help Running A Program

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Help Running A Program

Hi, I am new to the forum and have a simple request. I am a student taking a test on SAS and was given an assignment, however I do not have access to my PC and I am working with a Mac (no SAS access). I have two program that I need to run to check their accuracy and was wondering if anyone might be kind enough to help? If so, it would be greatly appreciated.

The value of sum (line 5) should be 14:

data repeat;

array alp(3) a1-a3 (3*2);

do i=anyalpha("&$#a987a") to "07jan1960"d;

dif=i-3;

alp(dif)=alp(dif)**dif;

sum + alp(dif);

end;

drop i ;

run;


My second question is as to whether or not this is a valid procedure, specifically the MEAN, MEDIAN, MIN and MAX portions of the TABLE function in line 10 (I am trying to calculate the mean, median and interquartile range for the data set scores):


PROC IMPORT DATAFILE = 'c:\MyComputer\Documents\demo_info.xls' OUT = scores DBMS = excel GETNAMES = yes; SHEET = hallo;

quarter = QTR(birth_date);

IF LENGTH(gender) <= 5 THEN gender = Male;

IF LENGTH(gender) >= 5 THEN gender = Female;

RUN;

PROC TABULATE DATA = scores;

CLASS gender quarter;

VAR score

TABLE gender ALL, MEAN*score* (quarter ALL) MEDIAN*score* (quarter ALL) MIN*score* (quarter) MAX*score* (quarter);

TITLE 'Mean, Median and Inter Quartile Range of scores by Gender';

RUN;


Accepted Solutions
Solution
‎11-12-2013 04:08 PM
Super User
Posts: 17,963

Re: Help Running A Program


All Replies
New Contributor
Posts: 2

Re: Help Running A Program

I would like to add that I am not looking for any help beyond yes/no answers, as this is for a school exam, and I am simply looking to replicate the resources I would have if I were operating on my own computer

Solution
‎11-12-2013 04:08 PM
Super User
Posts: 17,963

Re: Help Running A Program

1. Yes

2. No

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 149 views
  • 3 likes
  • 2 in conversation