By admin | September 25, 2009

SAS Certified Base Programmer 123 Questions (82)

A raw data record is listed below:

----|----10---|----20---|----30
Printing 750

The following SAS program is submitted:

data bonus;
    infile'file-specification';
    input dept $ 1 - 11 number 13 - 15;
    <insert code here>
run;

Which one of the following SAS statements completes the program and results in a value of ‘Printing750’ for the DEPARTMENT variable?

A. department = trim(dept) || number;
B. department = dept || input(number,3.);
C. department = trim(dept) || put(number,3.);
D. department = input(dept,11.) || input(number,3.);

3 comments | Add One

  1. admin - 09/25/2009 at 3:26 pm

    C

  2. b - 07/6/2012 at 5:32 am

    there is a mistake in input line. to answer ‘c’ was the correct one statement should look like:
    input dept $ 1 – 9 number 10 – 12;

    or to receive ‘Printing750′ without changing original input stmt one of the answear should look as follow:
    E. department = compress(dept)||’0’;

    but this applies to the trim function….

  3. Chris - 05/12/2013 at 9:14 am

    number is not in position 13-15 so in input statement would miss it completely.

Leave a Comment

Leave a Reply

Your email address will not be published.