0% found this document useful (0 votes)
33 views2 pages

Task Sheet

The document contains a series of SAS programming questions focused on data manipulation and formatting. It includes tasks such as calculating total compensation for employees, converting date formats, and determining the number of days in a month using SAS date values. Additionally, it asks about various date formats available in SAS for display purposes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

Task Sheet

The document contains a series of SAS programming questions focused on data manipulation and formatting. It includes tasks such as calculating total compensation for employees, converting date formats, and determining the number of days in a month using SAS date values. Additionally, it asks about various date formats available in SAS for display purposes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like