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



data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 ..

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

data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 ..

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

data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 ..

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

Post New Answer

More SAS Interview Questions

what is the Population you used in your project, is it ITT or PP?

0 Answers   Accenture, Quintiles,


How do you debug macros?

3 Answers   Accenture,


I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a different functionality. In my program I use bot these data sets. How do I specify which Age variable I want to use?

6 Answers  


Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro

0 Answers  


What is the Program Data Vector (PDV)? What are its functions?

5 Answers   Accenture,






What is program data vector (pdv)?

0 Answers  


What are the parameters of scan function?

0 Answers  


what versions of sas have you used (on which platforms)? : Sas programming

0 Answers  


Baseline definition in your study

3 Answers   Accenture, Quintiles,


Briefly explain input and put function?

0 Answers  


Have you been involved in editing the data or writing data queries?

1 Answers   BioServe, Oracle, Sasken,


how do you debug and test your sas programs? : Sas programming

0 Answers  


Categories