Basic SAS Interview Questions

August 4, 2017 | Author: dinesh441981 | Category: Sas (Software), Comma Separated Values, Variable (Computer Science), Sql, P Value
Share Embed Donate


Short Description

Download Basic SAS Interview Questions...

Description

Basic SAS interview questions 1.

What is the effect of the OPTIONS statement ERRORS=1?

2.

What’s the difference between VAR A1 - A4 and VAR A1 — A4?

3. What do the SAS log messages "numeric values have been converted to character" mean? What are the implications? 4.

Why is a STOP statement needed for the POINT= option on a SET statement?

5.

How do you control the number of observations and/or variables read or written?

6.

Approximately what date is represented by the SAS date value of 730?

7.

How would you remove a format that has been permanently associated with a variable??

8.

What does the RUN statement do?

9.

Why is SAS considered self-documenting?

10.

What areas of SAS are you most interested in?

11.

Briefly describe 5 ways to do a "table lookup" in SAS.

12.

What versions of SAS have you used (on which platforms)?

13.

What are some good SAS programming practices for processing very large data sets?

14.

What are some problems you might encounter in processing missing values? In Data steps? Arithmetic? Comparisons? Functions? Classifying data?

15. How would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? 16. What is the different between functions and PROCs that calculate the same simple descriptive statistics? 17.

If you were told to create many records from one record, show how you would do this using arrays and with PROC TRANSPOSE?

18.

What are _numeric_ and _character_ and what do they do?

19.

How would you create multiple observations from a single observation?

20.

For what purpose would you use the RETAIN statement?

21.

What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?

22. What is the order of application for output data set options, input data set options and SAS statements? 23.

What is the order of evaluation of the comparison operators: + - * / ** ( ) ?

24.

How could you generate test data with no input data?

25.

How do you debug and test your SAS programs?

26.

What can you learn from the SAS log when debugging?

27.

What is the purpose of _error_?

28.

How can you put a "trace" in your program?

29.

Are you sensitive to code walk-throughs, peer review, or QC review?

30.

Have you ever used the SAS Debugger?

31.

What other SAS features do you use for error trapping and data validation?

32. How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs? 33.

How many missing values are available? When might you use them?

34.

How do you test for missing values?

35.

How are numeric and character missing values represented internally?

Comments on Basic SAS interview questions What is the effect of the OPTIONS statement ERRORS=1? is printes on Log

//If ERRORS=1 then only 1 data error statement

What does the RUN statement do? //it will excutes the programme. How would you remove a format that has been permanently associated with a variable? What do the SAS log messages “numeric values have been converted to character” mean? What are the implications? //These SAS log messages shows that the all of the numeric values have been converted to character values. When using the put function in your program, the numeric values are converted into character values. How are numeric and character missing values represented internally? //ans:basically charactor values are reprasented by blank space numaric values are reprasented by dot in sas data set. What does the RUN statement do? //ans: it is end of the program it executes the program. What areas of SAS are you most interested in? access.

//ans:formats,macros,proc

sql,ods,graphsand

proc

How would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? //ANS:BY USING PROC TRANSPOSE. Que: For what purpose you use a retain statement? //Ans: To retain the value of a variable in subsequent iterations of the data step. What do the SAS log messages “numeric values have been converted to character” mean? What are the implications? //Ans) The message means that numeric values are converted into character values automatically whenever numeric data values are used in character context. If put function is used to explicitly convert numeric values to character values then no message is written to the log.

How do you control the number of observations and/or variables read or written? Ans) For controlling observations use OBS= option in the infile statement and for controlling variables use the VAR statement in the data step. Correction for Que5) Use the drop and keep options in the data statements. Approximately what date is represented by the SAS date value of 730? from Jan 1st 1960. 730=365+365=2 yrs = Jan 1st 1962

//Ans) SAS date value starts

How would you remove a format that has been permanently associated with a variable? //Ans) Open the dataset in viewtable window and right click on the columns whose format should be changed/removed and select column attributes from the pop up menu and then do the necessary changes. Why is a STOP statement needed for the POINT= option on a SET statement? is used to control the continuous looping in set stement

//The STOP statement

What’s the difference between VAR A1 - A4 and VAR A1 â€― A4? //A: VAR A1- A4 is a numbered range. Used as a shortcut to describe variables that have same char names and the numbers are in order. Var A1– A4 is the order of the variables as they occur in the data set, and is again a shortcut to refer them. You can see the order of the variables by using Proc Contents on the data file What do the SAS log messages “numeric values have been converted to character” mean? What are the implications? //A: Means SAS performed an automatic num to char conversion. Works for some cases, else do an explicit num to char conversion using PUT(VAR, format). What does the RUN statement do? //A: RUN stat menas the end of any Data or Proc steps before it and execute the stats. There can be as many RUN stats as you want to run blocks of steps separately. Q:What are some good SAS programming practices for processing very large data sets //A: Limit the no. of OBS using Firstobs= and obs=. Use a do loop and point= option to generate samples from the data sets. make sure you terminate the point= loop. Q: What are _numeric_ and _character_ and what do they do //A: the foist one means you want to work on all the numberis variables in your data set. example Mean( of _numeric_). Same with the char. Format _character_ $12. Q: How would you create multiple observations from a single observation? You can break up the single obs as per your need

//A: USing @ or @@.

Q: What is the order of evaluation of the comparison operators: + - * / ** ( ) Bracket, Div, Multi, add, subtraction)

//A:

Q: How can you put a “trace” in your program?

BODMAS

(

//A: ODS Trace ON, ODS Trace OFF

Q: Have you ever used the SAS Debugger? //A: YES. Start by submitting Data dat/ debug;…..Debugger window opens. Execute each program line by hitting enter. After the last line type Examine _ALL_ in the command window to execute and check the variable values for one iteration of data step.. What is the meaning of proc append procedure?How to use this procedure? What is the SAS server name and configuration? What is the effect of the OPTIONS statement ERRORS=1?

What is the purpose of _error_? Approximately what date is represented by the SAS date value of 730? //Ans) SAS date value starts from Jan 1st 1960. 730=365+365=2 yrs =dec 31st 1961 How are numeric and character missing values represented internally? //a.character values represented blank numeric values are represented by dot. What is the order of evaluation of the comparison operators: + - * / ** ( ) BODMASbrackets,explonentation,multiplication addition substraction.

//A:

What is the meaning of proc append procedure?How to use this procedure? //a.proc append procedure is used for adding one base dataset to existing dataset if incase there is mismatched variables then use force options. How would you remove a format that has been permanently associated with a variable? a.data ab; format ”; run; Important SAS Interview Questions 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20)

21) 22) 23)

What has been your most common programming mistake? What is your favorite programming language and why? What is your favorite operating system? Why? Do you observe any coding standards? What is your opinion of them? What percent of your program code is usually original and what percent copied and modified? Have you ever had to follow SOPs or programming guidelines? Which is worse: not testing your programs or not commenting your programs? Name several ways to achieve efficiency in your program. Explain trade-offs. What other SAS products have you used and consider yourself proficient in using? How do you make use of functions? When looking for contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc? What is the significance of the ‘OF’ in X=SUM(OF a1-a4, a6, a9);? What do the PUT and INPUT functions do? Which date function advances a date, time or date/time value by a given interval? What do the MOD and INT function do? How might you use MOD and INT on numerics to mimic SUBSTR on character strings? In ARRAY processing, what does the DIM function do? How would you determine the number of missing or nonmissing values in computations? What is the difference between: x=a+b+c+d; and x=SUM(a,b,c,d);? There is a field containing a date. It needs to be displayed in the format “ddmonyy” if it’s before 1975, “dd mon ccyy” if it’s after 1985, and as ‘Disco Years’ if it’s between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT. In the following DATA step, what is needed for ‘fraction’ to print to the log? data _null_; x=1/3; if x=.3333 then put ‘fraction’; run; What is the difference between calculating the ‘mean’ using the mean function and PROC MEANS? Have you ever used “Proc Merge”? (be prepared for surprising answers..)

24) If you were given several SAS data sets you were unfamiliar with, how would you find out the variable names and formats of each dataset? 25) What SAS PROCs have you used and consider yourself proficient in using? 26) How would you keep SAS from overlaying the a SAS set with its sorted version? 27) In PROC PRINT, can you print only variables that begin with the letter “A”? 28) What are some differences between PROC SUMMARY and PROC MEANS? 29) Code the tables statement for a single-level (most common) frequency. 30) Code the tables statement to produce a multi-level frequency. 31) Name the option to produce a frequency line items rather that a table. 32) Produce output from a frequency. Restrict the printing of the table. 33) Code a PROC MEANS that shows both summed and averaged output of the data. 34) Code the option that will allow MEANS to include missing numeric data to be included in the report. 35) Code the MEANS to produce output to be used later. 36) Do you use PROC REPORT or PROC TABULATE? Which do you prefer? Explain. 37) What happens in a one-on-one merge? When would you use one? 38) How would you combine 3 or more tables with different structures? 39) What is a problem with merging two data sets that have variables with the same name but different data? 40) When would you choose to MERGE two data sets together and when would you SET two data sets? 41) Which data set is the controlling data set in the MERGE statement? 42) How do the IN= variables improve the capability of a MERGE? 43) Explain the message ‘MERGE HAS ONE OR MORE DATASETS WITH REPEATS OF BY VARIABLES”. 44) How would you generate 1000 observations from a normal distribution with a mean of 50 and standard deviation of 20. How would you use PROC CHART to look at the distribution? Describe the shape of the distribution. 45) How do you generate random samples? 46) What is the purpose of the statement DATA _NULL_ ;? 47) What is the pound sign used for in the DATA _NULL_? 48) What would you use the trailing @ sign for? 49) For what purpose(s) would you use the RETURN statement? 50) How would you determine how far down on a page you have printed in order to print out footnotes? 51) What is the purpose of using the N=PS option? 52) What system options would you use to help debug a macro? 53) Describe how you would create a macro variable. 54) How do you identify a macro variable? 55) How do you define the end of a macro? 56) How do you assign a macro variable to a SAS variable? 57) For what purposes have you used SAS macros? 58) What is the difference between %LOCAL and %GLOBAL? 59) How long can a macro variable be? A token? 60) If you use a SYMPUT in a DATA step, when and where can you use the macro variable? 61) What do you code to create a macro? End one? 62) Describe how you would pass data to a macro. 63) You have five data sets that need to be processed identically; how would you simplify that processing with a macro? 64) How would you code a macro statement to produce information on the SAS log? This statement can be coded anywhere. 65) How do you add a number to a macro variable?

66) If you need the value of a variable rather than the variable itself, what would you use to load the value to a macro variable? 67) Can you execute a macro within a macro? Describe. 68) Can you a macro within another macro? If so, how would SAS know where the current macro ended and the new one began? 69) How are parameters passed to a macro? Re: Important SAS Interview Questions How to determine the executing program name and path programatically: Oftentimes, I was asked to keep the name and path of the executing program in the FOOTNOTE of the generated table or listings.I have always created a macro variable using the %let statement and, then I called the Macro variable in the footnote statement to get the name of the program. Eventhough it is simple.. it may not be suitable when we write application which need to self document... http://studysas.blogspot.com/2009/04/how-to-determine-executing-program-name.html ________________________________________________________________________________ How to check if a variable exist or not: In SAS sometimes, we need to check whether the variable is exist in the dataset or not, we usually run the proc contents program and physically check if the variable exist in the dataset or not.If we want to check it programmatically, then use the following code.... http://studysas.blogspot.com/2009/04/how-to-check-ifvariable-exists-in-sas.html _______________________________________________________________________________ How to check if the File is exist or not in SAS: Guys… Let me try explaining how to check if the file exist in the library or directory using SAS.Here I am writing a macro to check if the file exist in the directory or not.Here is the way to check it… http://studysas.blogspot.com/2009/04/how-to-check-if-file-is-exist-or-not-in.html _________________________________________________________________________________ SAS programming errors we make..... can be deadly sometimes The errors I will list here will be very few in number. They are errors that you will likely make at some time if you do not remain alert. These errors could have serious consequences so that is why I have described them as "deadly errors". http://studysas.blogspot.com/2009/03/sas-programming-errors-we-made-can-be.html _________________________________________________________________________________ Proc Sort NODUP vs NODUPKEY Somany times people from my orkut community asked me what is the real difference between the Proc sort Dodup and the Proc Sort nodupkey. I always wanted to answer the question in a better way…. and folkes… here is the answer ..... A common interview question for SAS jobs is "What is the difference between proc sort nodup and proc sort nodupkey?". The answer the interviewer is expecting is usually "proc sort nodup gets rid of duplicate records with the same sort key but proc sort nodupkey gets rid of other records with the same sort key". However, this is not correct. http://studysas.blogspot.com/2009/03/proc-sort-nodup-vsnodupkey.html

__________________________________________________________________________________ PROC TRANSPOSE: How to Convert Variables(columns) into Observations(ROWS) and Observations(ROWS) into Variables(Columns) During my early days as a SAS programmer, I get confused very easily with PROC TRANSPOSE. I mean, I get confused with what are the variables that I need to include in BY statement and ID statement as well as in VAR statement. http://studysas.blogspot.com/2009/03/proc-transpose-how-to-convert.html _________________________________________________________________________________ Displaying the Graphs (Bar charts) using PROC GCHART in SAS Displaying the Graphs (Bar charts) using PROC GCHART in SAS :Just a day ago, I have received a question on Graphs in my orkut community, which prompted me to create following examples.Below are 5 different types of Graphs were produced (including 3d graphs) using Proc Gchart. http://studysas.blogspot.com/2009/03/displaying-graphs-bar-charts-using-proc.html ________________________________________________________________________________ Change all missing values of all variables into zeros/putting zeros in place of missing values for variables I always wondered how do I convert missing values for all the variables into zeros and In this example the I have used array to do the same. The variable list includes ID and Score1 to score6.Using simple array method we can change all the missing value for the variables score1 to score6 to 0. http://studysas.blogspot.com/2009/03/change-all-missing-values-of-all.html _________________________________________________________________________________ How to Save LOG file in the required location: Here is the simple code which allows us to save the log file in the required location. Use Proc printto procedure to save or print the log file. filename dsn ‘C:\Documents and Settings\zzzzzzzzzzzz\Desktop\LOGfile.lst' http://studysas.blogspot.com/2009/03/how-to-save-log-file-or-what-is-proc.html ____________________________________________________________________________________ Calculating group totals and the counts within each group Sample 25217: Calculating group totals and the counts within each group This example uses the SUM() function to sum the AMOUNT column, creating a new column named GRPTOTAL with a COMMA10. format. The COUNT() function counts the number of occurrences of STATE within each group. The GROUP BY clause collapses multiple rows for each group into one row per group, containing STATE, GRPTOTAL and the COUNT. http://studysas.blogspot.com/2009/03/calculating-group-totals-and-counts.html ____________________________________________________________________________________ How to customize page numbers in RTF output In SAS 9.1, are there easier ways to customize page numbers in RTF output? Yes, beginning with SAS 9.1, page numbers can be customized in the RTF destination by using an escape character and the {thispage} function, {lastpage} function, {pageof} function, or all three: http://studysas.blogspot.com/2009/03/how-to-customize-page-numbers-in-rtf.html

____________________________________________________________________________________ How to calculate number of years and number of days between 2 dates; How to calculate number of years and number of days between 2 dates;Exploring the yrdif and datdif functions in SAS as well as INTCK function:There are several ways to calculate the number of years between two dates and out of all the methods, YRDIF function results the most accurate value. http://studysas.blogspot.com/2009/03/how-to-calculate-number-of-years-and.html ___________________________________________________________________________________ How to create a comma separated file (.csv) of a SAS dataset? IN SAS programming, we often require outputting the dataset in different formats like EXCEL and CSV etc and here are the five different ways to export the SAS dataset into .csv file. http://studysas.blogspot.com/2009/02/how-to-create-comma-separated-file-csv.html ____________________________________________________________________________________ How to Import Excel files into SAS Microsoft Excel spreadsheets can be read from SAS in several ways. Two of these will be demonstrated here. First, PROC IMPORT allows direct access to Excel files through SAS/Access to PC File Formats or access to Comma-Separated (CSV) files through Base SAS. The second method uses the Excel LIBNAME engine. http://studysas.blogspot.com/2009/02/how-to-import-excel-files-into-sas.html __________________________________________________________________________________ How to store a number more than 8 digits for a numeric variables Q&A: numeric variables length more than 8? We all know that the default length of the numeric variables in SAS is 8 and if suppose I want to store a number lets say (12345678910, which has a length 11 to numeric variable) to variable total, what should I do? http://studysas.blogspot.com/2009/02/how-to-store-numbermore-than-8-digits.html ___________________________________________________________________________________ Options VALIDVARNAME=UPCASE VALIDVARNAME= V7 UPCASE ANYVALIDVARNAME= option is generally used in SAS whenever we want to control the SAS variable names in the dataset. http://studysas.blogspot.com/2009/02/optionsvalidvarnameupcase.html ___________________________________________________________________________________ How to merge data sets with a common variable? Here is the simple way of merging the data sets with a common variable if the datasets has the same prefix name.For example: col1-col10, dsn1-dsn 7 , or data1 to data10 with common variable of ID.Considering we have 10 datsets and all of them having the same prefix data; http://studysas.blogspot.com/2009/02/mergingdata-sets-with-common-variable.html _____________________________________________________________________________________ Merging the data sets with a common variable if the datasets has the same prefix name?

For example: col1-col10 dsn1-dsn 7 data1 to data6 with common variable of Usubjid.here is the example, I have 7 datasets i need to merge and each of them having the common variable(usubjid) to merge, and all the datasets having the same prefix dsn(dsn1 to dsn7). http://studysas.blogspot.com/2009/02/merging-datasets-using-macro-code.html ____________________________________________________________________________________ when to use &,&&,and &&&,how do we distinguish(Multiple Ampersands) and Diff. Between single dot and double dots in macros Here are the 2 important questions always comes up in our minds,(& vs && vs &&& and single dot and double dots) when we are dealing with macros for the first time and here are the answers for them.I did find a very good regarding the above topics in the one of the SAS forums and IAN WHITLOCK explained it very clear. http://studysas.blogspot.com/2009/02/3when-to-use-do-we-distinguishmultiple.html ____________________________________________________________________________________ How can I count number of observations per subject in a data set? We always have this question in mind, while we do the SAS programming and here is the simple answer for that, we just need to use SUM statement and the FIRST.variable in the SET statement and then the RETAIN statement to calculate the observations count per subject. http://studysas.blogspot.com/2009/02/howcan-i-count-number-of-observations.html _____________________________________________________________________________________ How to remove the duplicate observations in the dataset using PROC SQL, DATASTEP/PROC SQL/or PROC SORT etc? Before using a particular step to remove the duplicate observations, we should understand that the duplicate observations are pertaining to the key variables like usubjid, treatment, patientno. etc, which are unique or exact duplicates( 2 or more observations has the duplicates with respect to all the variables in the dataset).If the observations are exact duplicates with respect to all the variables in the dataset, we can remove the exact duplicates by: http://studysas.blogspot.com/2009/02/how-to-remove-duplicate-observations.html _____________________________________________________________________________________ How to scan more than 20 records to determine variable attributes in EFI: In Versions 7 and 8 of the SAS System, by default the Import Wizard, PROC IMPORT and the External File Interface (EFI) scan 20 records to determine variable attributes when reading delimited text files.Changing the default setting can only be done for EFI in Version 7, Release 8 and Release 8.1. Beginning in Release 8.2 changing t he default setting is applicable to the Import Wizard, PROC IMPORT and EFI. http://studysas.blogspot.com/2009/02/how-to-scan-more-than-20-records-to.html _____________________________________________________________________________________ Macro for sorting the variables: How to convert character date values into numeric date values using DATASTEP/PROC SQL and ARRAYS: How to detect missing values using Arrays: First. & Last. Variables: How to determine the last observation in the dataset:

How to determine whether a numeric or character value exists within a group of variables: Lag Function: How to obtain information from the previous observation: How to create a new dataset from multiple datasets based on the sorted order: Dynamically generate SET statement to combine multiple datasets: How to determine which dataset contributed an observation: How to determine if a variable exists in a dataset or not: How to Read Delimited Text Files into SAS: How to keep only even number observations in the dataset: How to verify the existence of an external file: Accurately calculating age in one line code: How to use INDEX/INDEXC functions: Finding the number of observations in the dataset: How to capitalize first letter of the every word:/ PROPCASE FUNCTION: How to use the SCAN function: Concatenation functions in SAS 9.0: SOUNDEX Function: IFC and IFN functions:new IF functions & IF-THEN-ELSE vs SELECT: How to remove the duplicate observations from the dataset using PROC SQL, DATASTEP/PROC SQL/or PROC SORT approaches ? How can I count number of observations per subject in a data set? How to save the log file or what is PROC PRINTTO procedure How to calculate number of years and number of days between 2 dates; How to customize page numbers in RTF output How to create a comma separated file (.csv) of a SAS dataset? Change all missing values of all variables into zeros/putting zeros in place of missing values for variables ____________________________________________________________________ Base SAS Certification Summary---Functions: SAS Functions can be used to convert data and to manipulate the values of character variables. Functions are written by specifying the function name, then it's arguments in parentheses. Arguments can include variables, constants, or expressions. Although arguments are typically separated by commas, they can also be specified as variable lists or arrays. http://studysas.blogspot.com/2009/01/base-sas-certification-summary.html ____________________________________________________________________________________

http://studysas.blogspot.com/2008/11/sas-certification-assignments.html _____________________________________________________________________________ HOW TO CREATE A SAS TRANSPORT(XPT) FILE http://studysas.blogspot.com/2008/12/how-to-create-transport-file.html ______________________________________________________________________ How to Debug the SAS code: Question:I have a huge SAS program that isn't working. The results I get are not right but there are no errors or warnings in the SAS log. How can I figure out where I went wrong? http://studysas.blogspot.com/2008/11/how-to-debug-sas-code.html how to import XTP files into SAS datasets? 7 Barclays WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ? 181 Satyam what is null hypothesis? why do you consider that? 146 Accenture whenever we using the merging through data set merging ,we can get note in log like this "MERGE STATEMENT HAS MORE THAN ONE ONE DATASET BY REPEATED BY VAIABLES" but the output has come in good manner,whenever in in sql(full join) we can get cartion product.so How do overcome this problem in sql? 111 Accenture What is your favorite all time computer book? Why? 249 Oracle Of all your work, where have you been the most successful? 389 Oracle How necessary is it to be creative in your work? 186 Oracle Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX. 300 what is study design in while working with SAS? what are screening variables in SAS? 69 What are the difficulties u faced while doing vital signs table or dataset? 135 what is information maps? 184 CitiGroup /* This is example of age caluculate wihtout to display perfect days and years in output window */ data age; retain dob "12jun2003"d now "24may2011"d; age1=now-dob; age=(now-dob)/365.25; years=int(age); days1=round((age-years)*365.25); months=month(now)-1; if days1 gt 30 and months in(12,10,8,6,4,2)then do;

month1=days1/30.4375; month=int(days1/30.4375); if day(now)=1 then days=1; else days=round((month1month)*30.4375)+1; drop days1 month1 month; end; else if days1 gt 30 and months in (1,3,5,7,9,11)then do; month1=days1/30.4375; month=int(days1/30.4375); if day(now)=1 then days=1; else days=round((month1month) *30.4375); drop days1 month1 month; end; drop age age1; proc print data=age; format dob now date.; run; Emerio 1 81 1 new york 7,262,700 2 los angeles 3,259,340 3 philadelphia 1,642,900 how to read the above data using input statement consider the above data is in txt format externally u have to use infile and input statement. Quintiles 6 205 How to get the repeated values by using sql in sas ? 0 59 what is the difference between proc means and proc summary? Accenture 2 195 duplicates by using proc sql? Genpact 1 344

how to delete the

how to remove the duplicates by proc sql? Genpact 1 214 How can I remove header from output data set? 0 71 what is ae onset date n what is RDS Accenture 0 58 i have a data set with 20 observations i want label from 8 to 15 observations ? how you create this one. CTS 4 636 What is criteria for adverse events and treatment-emergent adverse events? Accenture Why do we use QUIT commmand for proc datasets and proc sql ??? 2 461 it will become easy if uuu provide website linkssss and list of consultanciessssss 0 56 Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary? How to get any kind of data in SAS? Is it possible to take data from notepad in SAS? GSK How to convert .xls file into CSV format? Quintiles What are types of transport files? Quintiles which stats created by proc means that are not created by proc summary or vice versa? GSK how to handle in stream data containing semicolon in it? what is study design in while working with SAS? what are screening variables in SAS? what is in stream data in SAS? What is instream data in SAS? Can you calculate the mean, median and mode of the following data set using data step logic? Don't use any function or procedure. data a; input age @@; datalines; 22 32 32 32 43 23 24 56 45 54 28 29 27 26 25 28 30 20 18 37 36 47 46 56 19 20 ; run; I have calculated the mean which i have posted in the answer section. HSBC How do you convert basic cube to transaction cube and transaction cube to basic cube? what is syntax of proc merge ? TCS

Which is the best training Institute for SAS Business Intelligence course? Hi, I need to create a SAS Map of USA using SAS Graphs(Proc Gmap).The data i have dosent contain any coordinates of USA cities or counties or states, and the zip codes are diffrent in the data i have from the zip code in the Maps.US dataset in the Maps Library for SAS MAPS. the data i have is a sales report. i have to generate the maps according to the states,cities aligned in the sales data, HELP Appriciated What is SAS? is it a software just for use or we can creat something over there? Cognizent what is difference in window SAS & Unix SAS.....how do define working environment in both??? JPMorganChase How will you use the WHO Drug Dictionary for Reporting Clinical Trials? Do you need to rearrange the order of the data for the report? Do you need to compute new variables? If so,should you do this before you execute the report-writing procedure? 0 61 Do you need to combine data sets? How should you combine data sets– MERGE or SET statements in DATA steps,PROC APPEND,PROC SQL? Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure? How are the analysis data sets structured? What data sets do you need to produce the report? Novartis what is the difference between proc means and proc tabulate? CTS which domain is better in sas? clinical trails or banking I need help in merging two different datasets. I am merging by date and I want to propagate observations from one dataset to the corresponding dates. One dataset has a unique date for each day of the month, while the other dataset has same date for different patient visits. For example I want to spread an observation on the 31DEC2008 from one dataset to several observations with the same date on a second dataset for all the patients who visited on that date. I have tried to merge the two and the result is not what I wanted. Instead I get a dataset whereby all the dates have missing values where observations from the first datset should have spread. how can u convert this 25-jul-2010 from numeric to charcter? Tell different ways to create Macrovarible? Accenture How to convert HTML file into SAS dataset? whenever we using the merging through data set merging ,we can get note in log like this "MERGE STATEMENT HAS MORE THAN ONE ONE DATASET BY REPEATED BY VAIABLES" but the output has come in good manner,whenever in in sql(full join) we can get cartion product.so How do overcome this problem in sql? Accenture 0 how do i get last 10obs from a dataset when we don't know about the number of obsevations in that dataset? TCS

I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). what are the different ways of merging two datasets.name atleast 4. Hot to suppress characters from a given string? CTS How to write duplicate records into a separate dataset using sort? HSBC How can you get the single data set from the library(which has the number of data sets)? Accenture Why Info School? BUILD YOUR CAREER WITH RIGHT GUIDANCE AND SUPPORT Why Info School? BUILD YOUR CAREER WITH RIGHT GUIDANCE AND SUPPORT SAS Training in Data Management at InfoSchool Bangalore How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? //We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas? What is proc sql pass through facility? L&T The below code we are using for creating more than one macro variables in proc sql using into clause. How we can use same code to create macro variables vara, varb, varc instead of var1, var2, var3.? proc sql noprint; select count(distinct(patient)) into :var1 - :var3 from dataset1 group by trtreg1c ; quit; Accenture Write SAS codes to compare two datasets. Suppose the allowable difference is 0.1. Write a SAS macro to calculate number of numbers in an email address. When merging 2 datasets with a common variable (not merge key), how to keep both? Please write codes to merge two datasets and keep every record in the first dataset. You need to perform an analysis on a massive dataset by groups, but are unable to sort the data due to memory constraint. How would you accomplish the task? What is LOGICAL VARIABLES in SAS.And how it can be used..Can anyone support..??? You need to create an In List that it is to be later used in a Where Clause that includes all the Regions that begin with the letter A from the sashelp.shoes table. Using PROC SQL with an into clause create the following string from the sashelp.shoes table using the variable region “AFRICA”,”ASIA”,….. What happens in the following code, if u type 8 instead of *? proc sql noprint; create table abc as select 8 from lib.abc; quit; What are the difficulties u faced while doing vital signs table or dataset?

We have a string like this "kannafromsalembut" ,from this i want to get only "fromsal" (but one condition with out using substring function)here we can not use scan because in the given string there is no delimeter? so give ans without out using substring ? How to get part of string form the source string without using sub string function in SAS? how to read character value without using substr function in sas ? proc means? proc sort? proc append? proc freq? proc print? proc content? Oracle What is the order of evaluation of the comparison && logical && relational operators:? CitiGroup PROC SQL always ends with QUIT statement.Why cant you use RUN in PROQ SQL ? HP What is shift table? have you ever created shift that? Accenture What are the rows present in protocol Violation table? Accenture What are all the problems you faced while validating tables and reports? Accenture What are TEAEs Accenture How do you validate tables abd reports? Accenture What procedure you used to calculate p-value? Accenture What are the efficacy variables in your study? Accenture Baseline definition in your study Accenture What kind of variables are collected in AE dataset? Accenture What are the considerations when picking a SAS/STAT procedure? Accenture How do you derive descriptive statistics? Accenture What is chi-square test? have you used that? Accenture What is null hypothesis? why do you consider that? Accenture What is p-value? Accenture What is the Population you used in your project, is it ITT or PP? Accenture For report generation which one you used proc report or data_null_? Accenture In proc transpose and data step with arrays which one you pick? Accenture Did you used proc lifetest? when? Accenture Did you used proc test? when? Accenture What are all the reports you generated in your recent project? Accenture What is the primary variable in your study? Accenture How the Excel file enter into the SAS environment without Code of Infile & Import procs,if i have no file Conversion? Reddy-Labs

How to get second top scorer student from a class- table having different sections A, B, C & D? each section has same number of student. How to get top scorer student from a class-table having different sections A,B, C & D? Each section having same number of students. What are Dashboard reports?And significance of these in analysis? How to get second highest salary from a employee table and how get a 5th highest salary from a employee table? ABC Which is the best place to learn SAS clinicals and Oracle clinical in hyderabad? What is prime numbers? how we can get plc write sas code? Icon You have a data set of 100 observations,how can you restrict the output so that the output has only data from row no. 10 to row no. 20 How to extract data from SAP servers? Is like oracle servers or any other methods to extract please reply me. If we dont want to print output what we have to do..???give syntax..??? GSK-GlaxoSmithKline What type of reports you are generating in your company...??? GSK-GlaxoSmithKline What type of tables you are using in YOUR reporting..??? GSK-GlaxoSmithKline What are all the default values getting in PROC MEANS...??? What are all the ways to define macro variable?? GSK-GlaxoSmithKline Is it possible to generate sas datasets using proc print ??? GSK-GlaxoSmithKline If i having variables named a b c d e f ,how to find total of each variable ????give syntax...?? Accenture What cause the "error: connect:" and "error in the libname statement" when there weren't any such problems? Hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also? Pfizer Hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also? Pfizer How to Rename Library? What is Transaction...? And what are Comment, Roll back n Save point..? What is difference between Global n Local Macro Variables..? TCS What is Tabulate.Why we use it.? Which type of output we get from Tabulate.? TCS What are the functions done while Compilation...? TCS One way of creating a new variable in Macros is by % Let....What is the other way..? TCS In which format does Date stores in sas..? What is the use of DATE in SAS.? TCS

What are symbol tables? Difference between Local N Global Symbol tables..... TCS What r all the reporting procedures...? What is univariate n where it can be used n how...? What are exact SAS Base contents..?N what r SAS Tools..? How many versions came upto now in SAS? CTS data abc; input x y ; cards; 1 2 5 6 7 8 7 8 1 7 5 7 ; run; Proc Freq data=abc; tables x*y / chisq nopercent nocol norow PLCORR; RUN; If we run the code, we have Polychoric Correlation = 0.9054 in the last table. I want to extract this particular entry with the value. Means I will create one dataset in which this value will be stored/extracted. I need your help in coding this. Please help me out. 2 612 Which is the best training institute for SAS in Delhi. Please reply HCL is QUALCOMM using SAS ? How do you add a prefix to some or all variables in a dataset using a SAS macro? How do you download a flat file from Mainframe to your local PC using SAS? What are the methods that you would employ to fine tune your SQL extract process using SAS/Access or Proc SQL? Name few built in sas transformation in DI studio ? SAS WHAT IS SAS WEB SERVICE and what are the steps to create an xml service? Satyam What are system option ? Give few examples ? What are dataset options and dataset statements ? if there is a keep option and keep statement ? which one is executed first ? Difference between a WHERE statement and IF statement? What is the advantage of using WHERE statement option on the dataset? Satyam What is SAS ACCESS AND SAS CONNECT? Give an example and data statements used. TCS HOW DO WE CREATE A SAS STORED PROCESS IN SAS EG? TCS What is incremental update? is this possible in SAS OLAP CUBE STUDIO. TCS What are different types of sas servers? On which server does the sas code execute? TCS What is SAS Information Map Studio and its purpose? TCS How does sas know on which server the piece of code to be executed? Say if a proc olap code is written then how the sas application would detect on which server to execute. TCS How can a SAS WEB REPORT STUDIO USER identify which report tabs they have been permitted without entering the SAS WEB REPORT STUDIO TCS 2 575 Which are SAS Windows Clients & SAS Java Clients TCS We want to merge file A and B. File A has variable age, file B provide birthdate. How to merge the data according to age in file B

What are the joins,types of joins and thier functions? SAS In the SAS Data step what is the difference between the subsetting done by Where and subsetting done by If? Cognizent Does anybody has lastest SAS certification dumps,if anybody has please mail me on [email protected] What is the difference between SAS Data step and SAS PROC SQL, and which is better? What is difference between sas rename and lable? What is PhaseIII, ODS, TLG, Macro and Proc in SAS 0 300 MERGE? Accenture What is the difference Assumptions/Conditions?

between

Regression

and

what is Difference between PROC SQL JOINS and

Logistic

Regression?

Can

u

explain

the

How to perform paired t-test using Base/SAS & SAS/Stat? How do i read multiple spaces in datasets? How to do user inputs and command line arguments in SAS? D&B BoA There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it? Hi I have list of products in a dataset, which are classified by other name for eg:- there is a product A> Malambo Shiraz Malbec 750ML(0388) which is a Red wine.Now i need to generate a report where it shows if this product appears then it should b displayed as red wine,similarly for other products and other classification. I dont wan use proc format. Symphony How to convert a given date value into SAS date CitiGroup What is the difference between Proc tabulate and Proc print CitiGroup data study; input Subj : $3. Group : $1. Dose : $4. Weight : $8. Subgroup; x= input(Weight,5.1); datalines; 001 A Low 220 2 002 A High 90 1 003 B Low 193.6 1 004 B High 165 2 005 A Low 123.4 1 ; Why does X get truncated? X shows up as 22 instead of 220,9 instead of 90 and 19.8 instead of 198? This problem doesnt happen with the values 193.6 and 123.4. This does not happen if x is read on the 5. informat instead of the 5.1 informat 2 566 In this question, I rename the numeric variable phone to numphone and then try use phone=put(numphone,comma16.) to store the numeric value numphone as a string value in phone. But I get a warning tha numphone already exists and in the data sat phone doesnt exist and numphone is set to missing. Why? data names_and_more; input Name $20. Phone : comma16. Height & $10. Mixed & $8.; Name = tranwrd(Name,' ',' '); rename phone = numphone; phone = put(numphone,comma16.); datalines; Roger Cody 9,087,821,234 5ft. 10in. 50 1/8 Thomas Jefferson 3,158,488,484 6ft. 1in. 23 1/2 Marco Polo 8,001,234,567 5Ft. 6in. 40 Brian Watson 5,183,551,766 5ft. 10in 89 3/4 Michael DeMarco 4,452,322,233 6ft. 76 1/3 ; 1 506 If you set a label in the data step and call a proc freq on the data, how do you display the data without the labels and just the variables? I use NOCUM/NOPERCENT option in the tables statement like this Proc freq data = deepak; tables x y /nocum nopercent; run; Here I get nopercent and nocum in the output only for variables x and y. How do i do it for all variables? Deepak

I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a different functionality. In my program I use bot these data sets. How do I specify which Age variable I want to use? 3 910 data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 67 D 2 4 3 3 39 R 4 4 4 4 19 D 2 1 2 1 75 D 3 3 2 3 57 R 4 3 4 4 ; Idont understand what the (Ques1-Ques4)($1. + 1) means. I have seen (Ques1-Ques4)(4*$1.), but what is (Ques1-Ques4)($1. + 1)? libname deepak 'C:\SAS Files'; proc format; invalue convert 'A+' = 100 'A' = 96 'A-' = 92 'B+' = 88 'B' = 84 'B-' = 80 'C+' = 76 'C' = 72 'F' = 65; data deepak.grades; input ID $3. Grade convert.; *format Grade convert. ; datalines; 001 A- 002 B+ 003 F 004 C+ 005 A ; proc print data = deepak.grades; run; I get the following output Obs ID Grade 1 001 . 2 002 . 3 003 . 4 004 . 5 005 . I don’t understand why Grade shows up as a missing value. Everything seems fine, including ID $3. Now, in case I use ID : $3. Or use column input, I get the desired output. Kindly help What would the following datastep do? Data _null_; Set Dist end=eof; Call Symput("xx"!!left(put(_n_,2.)),&dimension); If EOF then Call Symput('numrows',left(put(_n_,2.))); Run; dimension is a macro variable that is being passed here How to import the Zip files into SAS? If it is possible in SAS? If it is posible write the code... a clinical sas programmer write the code and after successful execution where do they store it. how they submit tables to TL how work is assigned to programmers either both code, log, output to be submitted. can any one tell me the process HSBC data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt=y.startdt and x.dt
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF