28743095-SAS-Interview-Questions

28743095-SAS-Interview-Questions - SAS Interview...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
SAS Interview Questions:Base SAS Very Basic:· What SAS statements would you code to read an external raw data file to a DATA step? INFILE statement. · How do you read in the variables that you need? Using Input statement with the column pointers like @5/12-17 etc. · Are you familiar with special input delimiters? How are they used? DLM and DSD are the delimiters that I’ve used. They should be included in the infile statement. Comma separated values files or CSV files are a common type of file that can be used to read with the DSD option. DSD option treats two delimiters in a row as MISSING value. DSD also ignores the delimiters enclosed in quotation marks. · If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn't have a value? By using the option MISSOVER in the infile statement.If the input of some data lines are shorter than others then we use TRUNCOVER option in the infile statement. · What is the difference between an informat and a format? Name three informats or formats . Informats read the data. Format is to write the data. Informats: comma. dollar. date. Formats can be same as informatsInformats: MMDDYYw. DATEw. TIMEw. , PERCENTw,Formats: WORDIATE18., weekdatew. · Name and describe three SAS functions that you have used, if any? LENGTH: returns the length of an argument not counting the trailing blanks.(missing values have a length of 1)Ex: a=’my cat’;x=LENGTH(a); Result: x=6… SUBSTR: SUBSTR( arg ,position,n) extracts a substring from an argument starting at ‘position’ for ‘n’ characters or until end if no ‘n’. Ex: A=’(916)734-6241’;X=SUBSTR(a,2,3); RESULT: x=’916’ TRIM: removes trailing blanks from character expression. Ex: a=’my ‘; b=’cat’;X= TRIM(a)(b); RESULT: x=’mycat’. SUM: sum of non missing values.Ex: x=Sum(3,5,1); result: x=9.0 INT: Returns the integer portion of the argument.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern