You have a SAS data set (NAMES) which contains the variables FIRST and LAST.As you can guess, these variables represent first and last names.You would like to create a new variable, NAME, which is the full name (first, a blank, and last).You need to join (in computer jargon— concatenate) the first name,a blank,and the last name.Using the concatenation operator (II) you can proceed as follows:
Since the concatenation operation does not remove blanks, you need to use the TRIM function (which removes trailing blanks) before concatenating the single blank and the last name.Otherwise,the variable NAME could contain more than a single blank between the first and last names. For example, if FIRST was equal to Ron (5 blanks) and LAST was equal to Cody (4 blanks),the value of FIRST | | ' ' | LAST would be Ron Cody (6 blanks between the first and last name).The TRIM function removes all the blanks in FIRST,so we need to concatenate the single blank between the first and last names.
a. The natural (base e) log of SCORE.
b. The arcsine of the square root of PROP.
c. IQ rounded to the nearest 10 points
d. A character variable which is derived from the first two digits and the last two digits of the numeric variable ID. For example, if ID=12345, the new character variable would be the string 1245.
Here are some sample data for you to work with:
a. Compute the sum of the non-missing values in variables X1-X20.
b. Compute the mean of Y1-Y20. If there are 5 or more missing values of Y1-Y20, set the mean equal to a missing value.
c. Find the minimum and maximum of the X's.
where n must be a digit 0-9.Extra spaces are permitted, but assume all numbers willbe 15 characters or less. Have your program place the valid numbers in data setVALID, and the invalid numbers in data set INVALID.
Hint: Our solution used the following SAS functions: INDEX and VERIFY, but there
are many other possible solutions.
a) Use the PUT function to create a new variable in one of the data sets so that the two data sets have an identical variable to use.
b) Use an INPUT function to create a real SAS date variable in both data sets for merging.
Some sample data are shown below:
Hint: Use the LAGn family of functions.
Hint: You may want to use arrays. We provide solutions with and without them.
SAS Programming Related Tutorials
|SASS (Syntactically Awesome Style sheets) Tutorial||R Programming language Tutorial|
SAS Programming Related Interview Questions
|Logistics Interview Questions||SAS Programming,SQL server Interview Questions|
|Clinical SAS Interview Questions||SASS (Syntactically Awesome Style sheets) Interview Questions|
|SQL Server Analysis Services (SSAS) Interview Questions||R Programming language Interview Questions|
|SAS DI Interview Questions||Advanced SAS Interview Questions|
|Base Sas Interview Questions||SAS Macro Interview Questions|
|Clinical Data Management Interview Questions|
Sas Programming Tutorial
Input And Infile
Set, Merge, And Update
Table Lookup Tools
Proc Means And Proc Uimivariate
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.