The contents of the SAS data set PERM.JAN_SALES are listed below: VARIABLE NAME TYPE idnum character variable sales_date numeric date value A comma delimited raw data file needs to be created from the PERM.JAN_SALES data set. The SALES_DATE values need to be in a MMDDYY10 form. Which one of the following SAS DATA steps correctly creates this raw data file?
1. libname perm 'SAS-data-library'; data _null_; set perm.jan_sales; file 'file-specification' dsd = ','; put idnum sales_date : mmddyy10.; run; 2. libname perm 'SAS-data-library'; data _null_; set perm.jan_sales; file 'file-specification' dlm = ','; put idnum sales_date : mmddyy10.; run; 3. Access Mostly Uused Products by 50000+ Subscribers data _null_; set perm.jan_sales; file 'file-specification'; put idnum sales_date : mmddyy10. dlm = ','; run; 4. libname perm 'SAS-data-library'; data _null_; set perm.jan_sales; file 'file-specification'; put idnum sales_date : mmddyy10. dsd = ','; run;
Exp: First, in put statement, $ sign for character variable, Idnum is not needed. The correct answer is: 2 Ans, 1 is not correct as the default delimeter (,) for DSD is defined as dsd = ','. It is correct if it was used as: DSD Ans 3 and 4 are not correct because of using the options dlm and dsd in PUT statement. They are the INFILE options.
Question : A raw data record is shown below: 07Jan2002 Which one of the following informats would read this value and store it as a SAS date value? 1. date9 2. ddmonyy9 3. Access Mostly Uused Products by 50000+ Subscribers 4. ddmmmyyyy9
Question : The following SAS program is submitted: libname temp 'SAS-data-library'; data work.new; set temp.jobs; format newdate mmddyy10.; qdate = qtr(newdate); ddate = weekday(newdate); run; proc print data = work.new; run; The variable NEWDATE contains the SAS date value for April 15, 2000. What output is produced if April 15, 2000 falls on a Saturday? 1. Obs newdate qdate ddate 1 APR152000 2 6 2. Obs newdate qdate ddate 1 04/15/2000 2 6 3. Access Mostly Uused Products by 50000+ Subscribers 1 APR152000 2 7 4. Obs newdate qdate ddate 1 04/15/2000 2 7
Correct Answer : Get Lastest Questions and Answer : Exp: The QTR function returns a value of 1, 2, 3, or 4 from a SAS date value to indicate the quarter of the year in which a date value falls.
Value Day of the Week 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday 7 Saturday
1. It can be used to read character variables that contain embedded blanks 2. No placeholder is required for missing data. 3. Access Mostly Uused Products by 50000+ Subscribers 4. Fields do not have to be separated by blanks or other delimiters