SAS_Institute
A00-211 · Question #125
Given the SAS data set WORK.ORDERS: The variable Order_id is numeric; Customer is character; and Ship_date is a numeric containing a SAS date value. A programmer would like to create a new variable…
The correct answer is D. note=catx(' ','Order',order_id,'shipped on',put(ship_date,date9.)). See the full explanation below for the reasoning.
Question
Given the SAS data set WORK.ORDERS:
The variable Order_id is numeric; Customer is character; and Ship_date is a numeric containing a SAS date value. A programmer would like to create a new variable called Note, that shows a character value with the Order_id and Ship_date shown with a date9. format. For the first observation, Note would look like the following: "Order 9341 shipped on 02FEB2009". Which of the following statement will correctly create the value and assign it to Note?
Options
- Anote=catx(' ','Order',order_id,'shipped on',input(ship_date,date9.));
- Bnote=catx(' ','Order',order_id,'shipped on',char(ship_date,date9.));
- Cnote=catx(' ','Order',order_id,'shipped on',transwrd(ship_date,date9.));
- Dnote=catx(' ','Order',order_id,'shipped on',put(ship_date,date9.));
How the community answered
(67 responses)- A3% (2)
- B4% (3)
- C9% (6)
- D84% (56)
Community Discussion
No community discussion yet for this question.