data voter;
input Age Party : $1. (Ques1-Ques4)($1. + 1);
datalines;
23 D 1 1 2 2
45 R 5 5 4 1
67 D 2 4 3 3
39 R 4 4 4 4
19 D 2 1 2 1
75 D 3 3 2 3
57 R 4 3 4 4
;
Idont understand what the (Ques1-Ques4)($1. + 1) means.
I have seen (Ques1-Ques4)(4*$1.), but what is
(Ques1-Ques4)($1. + 1)?
Appreciate all help
Thanks
Answers were Sorted based on User's Feedback
Answer / nbohr02
You are read data for a 4 question poll
(Q1-Q4) is an arrary ($1. is the format of each element
+1) tells sas to increment the array index for each line.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / tsk
You are read data for a 4 question poll
(Q1-Q4) is an arrary ($1. is the format of each element
+1) tells that space b/n the each and every variable called
q1 ,q2 ,q3 ,q4.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / naveen
In this example you have to read the data after the party
variable specifying the numeric variables (Ques1-Ques4).
This way is possible only for numeric variables. $1.
specifying the column range(width of the data value) and +1
refers to eliminate the non required data.
| Is This Answer Correct ? | 1 Yes | 0 No |
What is the difference between SAS Data step and SAS PROC SQL, and which is better?
what are all the ways to define macro variable??
2 Answers GSK GlaxoSmithKline,
in data set200 observation how to take 110,150,170 using sql procedure?
how to add distinctly var variable values ex.. Data a; input var; datalines; 0 1 2 3 -1 -2 -3 ; run; adding all +ve value in one varibale n do the same for -ve too
Hi im new to sas. I have a file with some charecter variables and some numeric variables now i want to load charecter variables into one datastep and numeric variables into another data step pls let me know Thanks
if x=round(26.3,10)-1 then x= how much and how explain?
Explain the main difference between the sas procedures and functions? : Sas-administrator
Name and describe three SAS functions that you have used, if any?
Mention the difference between ceil and floor functions in sas?
Does SAS ?Translate? (compile) or does it ?Interpret?? Explain.
what is treatment emergent events and treatment emregent adverse event
how does sas handle missing values in formats? : Sas programming