Format & Informat
Question 1:
Write a SAS program to print the dataset and calculate the total Compensation (i.e. Salary +
Bonus) for each employee. Display the final Compensation in Output as DOLLAR format.
data employee;
input empid $ salary :comma8. bonus :dollar9.;
cards;
1001 75,000 $25,000
1002 13,000 $37,000
1003 2,67,000 $33,000
;
run;
Question 2:
Write a SAS program to read Subject’s trial enrolment date in monyy7. format and convert it
into date9. format for display purpose. The input raw data is given below :-
ptid enrldt
1001 mar2022
1002 jul2023
1003 oct2024
Question 3:
Write a SAS program to read Subject’s blood collection date/time and convert it into date11.
format for display purpose. The input raw data is given below:-
ptid coldtm
1001 12jan[Link]m
1002 22jan[Link]pm
1003 02feb[Link]m
r
Question 4:
Suppose your data step creates two variables from input dataset i.e. fday & lday, which are
stored as SAS date values. fday contain the start of month & lday contain the end of month.
If you would like to calculate the total number of days in month, which option would be
correct?
A) duration=lday-fday-1;
B) duration =lday-fday;
C) duration=lday-fday+1;
D) SAS date values cannot be use for calculation of number of days in month.
E-mail Id : [Link] Mobile : +91-7738017924/9321027195
Format & Informat
Question 5:
Which of the following formats can be used to display dates in SAS?
A) date9.
B) weekdate17.
C) ddmmyy10.
D) All of the above
E-mail Id : [Link] Mobile : +91-7738017924/9321027195