jaesmile.blogg.se

Sas interview questions by solasa
Sas interview questions by solasa







  1. #Sas interview questions by solasa how to
  2. #Sas interview questions by solasa pdf
  3. #Sas interview questions by solasa code

#Sas interview questions by solasa pdf

Write a Macro to get pdf report of orders placed in range of years with appropriate title?Įxample: If I select range of years 2003 to 2006, I should get pdf report of orders placed in all these years separately on desktop.ĥ.

sas interview questions by solasa

If I just mention year 2004, It should display frequency of all quantities ordered in 2004 with all types.Ĥ. Write a Macro to display the frequency of quantity ordered for given order type in any particular year.Įxample: If I mention value of year 2004 and type 3, It should display frequency of quantities placed in 2004 with type 3 with appropriate title. Suppose you have 3 Types of Orders and a variable Order_type having values either Type 1 Type 2 or Type 3 for Each Order Placed and you have another variable Quantity, having the total number of quantities ordered for each order. Consider Same Sales Data, Write a Macro to get summarized report on any particular year ?Įxample: I want to run proc means on sales data for the year 2004, may be tomorrow I want to get for 2005 or so.ģ. Title “Below are the details of Sales data for 01-January-2000” Ģ. If I call same macro on 02 January, It should give Report of orders placed on 02 January. Write a Macro that will Display the Report of all the Sales Conducted on Daily Basis ?Įxample: If today is 01 January 2000, If I call macro today, It shows orders placed on 01 January 2000. Consider you have Sales Data and a variable Order_date is the Date of Order Placed. Store value in each row of a variable into macro variablesġ. In the macro, user should have flexibility to change the number of datasets to be created.ģ1.

sas interview questions by solasa

Suppose you are asked to write a macro to split large data into 2 parts (not static 2). Write a macro to split data into N number of datasets %GLOBAL is used to create a global macro variable and would remain accessible till the end of a session. Two ways to assign incremental value by group Count Number of Variables assigned in a macro variablesĢ2.

#Sas interview questions by solasa how to

How to make SAS stop macro processing on ErrorĬheck out this link - Stop SAS Macro on ErrorĢ1. In PROC SORT, NODUPKEY option is used to remove duplicates based on a variable. How to use NODUPKEY kind of operation with PROC SQL The RANUNI function is used to generate random numbers. The RANUNI and OUTOBS functions can be used for selecting N random samples. The EXCEPT operator returns rows from the first query that are not part of the second query.ġ8. However, the value of i is now 4 and not 3, the last value before it would be greater than 3 as the stop value.ġ7. At the beginning of the fourth iteration, the value of count is 4, which is found to be greater than the stop value of 3 so the loop stops. It is because when the first time the loop processes, the value of count is 1 the second time, 2 and the third time, 3.

#Sas interview questions by solasa code

What would be the value of i after the code below completes It is when the %SYSEVALF function comes into picture.ġ6. %let last = %eval (4.5+3.2) returns error as %EVAL cannot perform arithmetic calculations with operands that have the floating point values. Difference between %EVAL and %SYSEVALF functionsīoth %EVAL and %SYSEVALF are used to perform mathematical and logical operation with macro variables. MLOGIC option will display how the macro variable resolved each time in the LOG file as TRUE or FALSE for %IF %THEN.ġ5. How to debug %IF %THEN statements in a macro code Use double quotes to reference a macro variable in a selection criteria. How to reference a macro variable in selection criteria

sas interview questions by solasa

You need to find out manager name against each employee ID.ġ3. It comprises of employees' name, ID and manager ID. Select count(*) into: nrows from sashelp.class ħ. Two ways to create a macro variable that counts the number of observations in a dataset Quit Tutorial : Learn PROC SQL with 20 ExamplesĦ. Where score in (select max(score) from example5 where score not in (select max(score) from example5)) Select the Second Highest Score with PROC SQL Please note that WHERE Option can be used for subsetting on a newly created variable. WHERE statement would return an error "newly derived variable is not on file". Only IF statement can be used for subsetting when it is based on a newly derived variable. Can both WHERE and IF statements be used for subsetting on a newly derived variable?









Sas interview questions by solasa