Posts

Showing posts from February, 2025

114.CLINICAL TRIALS INTERVIEW QUESTIONS IN SAS - 1

          CLINICAL  TRIALS  INTERVIEW QUESTIONS IN SAS - 1  1.Describe the phases of clinical trials?  Ans:- These are the following four phases of the clinical trials:   Phase 1: Test a new drug or treatment to a small group of people (20-80) to evaluate its safety.   Phase 2: The experimental drug or treatment is given to a large group of people (100-300) to see that the drug is effective or not for that treatment.  Phase 3: The experimental drug or treatment is given to a large group of people (1000-3000) to see its effectiveness, monitor side effects and compare it to commonly used treatments.  Phase 4: The 4 phase study includes the post marketing studies including the drug’s risk, benefits etc.  2. Describe the validation procedure? How would you perform the validation for TLG as well as analysis data set?   Ans:- Validation procedure is used to check the output of the SAS program generate...

113.SET | ASSIGNMENT | UPCASE | LOWCASE | DROP | LENGTH | IF THEN OUTPUT | LIKE

SET | ASSIGNMENT | UPCASE | LOWCASE | DROP | LENGTH | IF THEN OUTPUT | LIKE IN SAS DATA NEW;  SET PROG1.SALES;  NAME=UPCASE(FIRST_NAME||""||LAST_NAME);  DROP FIRST_NAME LAST_NAME; RUN; PROC PRINT;  VAR Employee_ID NAME Gender Salary;  RUN; OUTPUT: Obs Employee_ID NAME Gender Salary 1 120167 KIMIKO TILLEY F 25185 2 120168 SELINA BARCOE F 25275 3 121101 BURNETTA BUCKNER F 25390 4 121092 GYNELL PRITT F 25680 5 120138 SHANI DUCKETT F 25795 6 121047 KAREN GRZEBIEN F 25820 7 . LIBBY LEVI F 25930 8 121036 TERESA MESLEY F 25965 9 121051 GLORINA MYERS F 26025 10 . PATRICIA CAPRISTO-ABRAMCZYK F 26080 NOTE: DUE TO OVER SPACE ONLY 10 OBSERVATIONS ARE DISPLAYED HERE.. DATA NEW01;  LENGTH GENDER $8;  SET NEW;  IF EMPLOYEE_ID="" THEN OUTPUT; RUN; PROC PRINT;  VAR Employee_ID NAME Gender Salary ; RUN; OUTPUT: Obs Employee_ID NAME GENDER Salary 1 . LIBBY LEVI F 25930 2 . PATRI...

112.ASSIGNMENT STATEMENT | DATA STEP | SET STATEMENT

              ASSIGNMENT STATEMENT | DATA STEP | SET STATEMENT OBSERVE THE ASSIGNMENT STATEMENT WHICH IS PLACED WITH ALREADY AVAILABLE VARIABLE WITH SAME NAME AND DIFFERNT NAME.. DATA NEW;  SET SASHELP.CLASS;  GENDER=SEX; RUN; PROC PRINT;RUN; OUTPUT: Obs Name Sex Age Height Weight GENDER 1   M 12 57.3 83.0 M 2   M 12 59.0 99.5 M 3   F 13 56.5 84.0 F 4   F 15 66.5 112.0 F 5 Alfred M 14 69.0 112.5 M 6 Alice F 13 56.5 84.0 F 7 Barbara F 13 65.3 98.0 F 8 Carol   14 62.8 102.5   9 Carol F 14 62.8 102.5 F 10 Henry M 14 63.5 102.5 M 11 James M 12 57.3 83.0 M 12 Jane F 12 59.8 84.5 F 13 Janet F 15 62.5 112.5 F 14 Jeffrey M 13 62.5 84.0 M 15 John M 12 59.0 99.5 M 16 Joyce F 11 51.3 50.5 F 17 Judy   14 64.3 90.0   18 Judy F 14 64.3 90.0 F 19 Louise F 12 56....

111.SAS INTERVIEW QUESTIONS - 3

                 SAS INTERVIEW QUESTIONS - 3 11. Explain how to use PROC SQL for data manipulation and querying?  In Proc SQL we use   Select:Specifies the columns which you want.   From:Specifies the table from which you want to retrieve.   Where:Filter the data based on conditions.  Order By:It sorts the data in ascending or descending manner.  Group By:Group data based on one or columns.   Having:Filters Groups based on conditions.   Eg: Proc sql;   Select column1,column2   From dataset   Where condition   Order by column1  Exit; 12.How Would You Create A Frequency Table And Calculate Percentages Using SAS?  By using Proc Freq Statement and Colpctn,Rowpctn options are used to calculate percentages.  13. How To Use PROC FORMAT To Create Custom Formats? In Proc Format by using Value Statement we can create custom format...

110.PROC CONTENTS | SET | IF THEN OUTPUT STATEMENTS

       PROC CONTENTS | SET | IF THEN OUTPUT STATEMENTS PROC CONTENTS DATA=SASHELP.CLASS4; RUN; OUTPUT: Alphabetic List of Variables and Attributes # Variable Type Len Format Informat Label 3 Age Num 8 BEST18.   Age 7 CLASS Num 8 BEST15.   CLASS 6 DOB Num 8 DATE9.   DOB 8 GRADE Char 11 $11. $11. GRADE 4 Height Num 8 BEST18.   Height 1 Name Char 14 $14. $14. Name 2 Sex Char 11 $11. $11. Sex 5 Weight Num 8 BEST18.   Weight DATA NEWCLASS;  SET SASHELP.CLASS4;  IF AGE > 13 THEN OUTPUT; RUN; PROC PRINT;RUN; OUTPUT: Obs Name Sex Age Height Weight DOB CLASS GRADE 1 Alfred M 14 69 112.5 12OCT2009 9 A 2 Carol F 14 62.8 102.5 12NOV2009 9 B 3 Henry M 14 63.5 102.5 14NOV2009 9 C 4 Janet F 15 62.5 112.5 14NOV2009 10 A 5 Judy F 14 64.3 90 18DEC2010 9 A 6 Mary F 15 66.5 112 15DEC2009 10 A 7 Philip...

109.SAS INTERVIEW QUESTIONS - 2

                      SAS INTERVIEW QUESTIONS - 2 6. Describe different ways to combine datasets in sas (e.g., merge, set, append). When would you use each?  Already we know that different ways to combine datasets are   Merge : they combine datasets in horizontally using by statement.   Set: the dataset concatenates the other dataset in horizontally.   Append: the second dataset observations added to original dataset. When you want to add observations from one dataset to other dataset then use append statement.   When you want to combine datasets without matching conditions then use set statement.   When you want to combine datasets with matching conditions then use merge statement. 7. How do you handle missing values in sas? Discuss different missing value representations and functions like nmiss, cmiss, and missing.   Nmiss: returns the number of missing values...

108.SAS INTERVIEW QUESTIONS - 1

                      SAS INTERVIEW QUESTIONS - 1 1. What are some commonly used sas procedures for data analysis and reporting? Give examples of when you would use each.   Sas procedures for data analysis and reporting: proc means, proc freq, proc summary, proc univariate, proc anova, proc reg, proc print, proc report etc..   I have used for creating statistical and summarizing information and for customized and professional report in sas.. 2. How do you read data from different file formats (e.g., csv, txt, excel) into sas?  By using infile statement and import statement we can read data from different file formats... 3. How do you export sas datasets to different file formats?   By using export statement we can export data to different file formats... 4. How do you debug sas code? What are some common debugging techniques?  Debugging techniques are mprint, mlogic,symbolgen,put .....

107.SET | WHERE | KEEP | ASSIGNMENT STATEMENT | LIKE

      SET | WHERE | KEEP | ASSIGNMENT STATEMENT | LIKE  DATA WORK.CUSTOMER;          SET PROG1.CUSTOMER; WHERE Customer_FirstName like 'M%'; KEEP CUSTOMER_ID Customer_FirstName Customer_LastName GENDER COUNTRY; RUN; PROC PRINT; RUN; OUTPUT: Obs Customer_ID Country Gender Customer_FirstName Customer_LastName 1 13 DE M Markus Sepke 2 20 US M Michael Dineley 3 75 US M Mikel Spetz DATA WORK.CUSTOMER02;         SET PROG1.CUSTOMER; NAME=Customer_FirstName||','||Customer_LastName; KEEP CUSTOMER_ID Name Name GENDER COUNTRY; RUN; PROC PRINT; RUN; OUTPUT: Obs Customer_ID Country Gender NAME 1 4 US M James ,Kvarniq 2 5 US F Sandrina ,Stephano 3 9 DE F Cornelia ,Krahl 4 10 US F Karen ,Ballinger 5 11 DE F Elke ,Wallstab 6 12 US M David ,Black 7 13 DE M Markus ,Sepke 8 16 DE M Ulrich ,Heyde 9 17 US M Jimmie ,Evans 10 18 US M Tonie...

106.SET | PROC SORT | FIRST. | LAST. STATEMENTS

          SET | PROC SORT | FIRST. | LAST. STATEMENTS  Data Work.Emps;   Set Prog2.Empsals; Run; Proc Print; Run; OUTPUT: Obs EmpID Salary Div 1 E00004 42000 HUMRES 2 E00009 34000 FINACE 3 E00011 27000 FLTOPS 4 E00036 20000 FINACE 5 E00037 19000 FINACE 6 E00048 19000 FLTOPS 7 E00077 27000 APTOPS 8 E00097 20000 APTOPS 9 E00107 31000 FINACE 10 E00123 20000 APTOPS 11 E00155 27000 APTOPS 12 E00171 44000 SALES 13 E00188 37000 HUMRES 14 E00196 43000 APTOPS 15 E00210 31000 APTOPS 16 E00222 250000 SALES 17 E00236 41000 APTOPS 18 E00239 42000 FLTOPS 19 E00259 32000 APTOPS 20 E00260 39000 APTOPS 21 E00262 36000 FLTOPS 22 E00272 22000 FINACE 23 E00290 37000 FINACE 24 E00302 18000 HUMRES 25 E00333 36000 APTOPS 26 E00367 33000 FLTOPS 27 E00372 36000 HUMRES 28 E00379 25000 APTOPS 29 E00388 25000 APTOPS 30 E00402 ...

105.%LET | SET | WHERE | PUT | CALL SYMPUT | TITLE | FOOTNOTE

%LET | SET | WHERE | PUT | CALL SYMPUT | TITLE | FOOTNOTE Options Mprint; %Let Crsno=5; Data Revenue;  Set Mauto.All End=Final;  Where Course_Number=&Crsno;  Total+1;  If Paid="Y" Then Paidup+1;  If Final Then Do;    Put Total= Paidup=;    If Paidup<Total Then Do;     Call Symput("Foot","Some Fees Due");    End;    Else Do;     Call Symput("Foot","All Students Paid");    End;  End; Run; Proc Print Data=Revenue;   Var Student_Name Student_company Paid;   Title "Paid Status For Course &Crsno";   FootNote "&Foot"; Run; OUTPUT:                                               Paid Status For Course 5 Obs Student_Name Student_Company Paid 1 Albritton, Mr. Bryan Special Services Y 2 Babbitt, Mr. Bill National Credit Corp. Y ...

104.%LET | %PUT | %EVAL | MPRINT | MLOGIC | SYMBOLGEN | LOG PRINTTO

%LET | %PUT | %EVAL | MPRINT | MLOGIC | SYMBOLGEN | LOG PRINTTO %LET A=450; %LET B=550; %LET K=%EVAL(&A+&B); %PUT TOTAL IS &K; LOG: 5    %PUT TOTAL IS &K;         TOTAL IS 1000 OPTIONS MPRINT MLOGIC SYMBOLGEN; %LET A=SHIVA; %LET B=SHANKAR; %LET C=RAO; %PUT &A; %PUT &B; %PUT &C; %LET V=A B; %PUT &&&V &&&&A; LOG: 7    OPTIONS MPRINT MLOGIC SYMBOLGEN; 8    %LET A=SHIVA; 9    %LET B=SHANKAR; 10   %LET C=RAO; 11   %PUT &A; SYMBOLGEN:  Macro variable A resolves to SHIVA SHIVA 12   %PUT &B; SYMBOLGEN:  Macro variable B resolves to SHANKAR SHANKAR 13   %PUT &C; SYMBOLGEN:  Macro variable C resolves to RAO RAO 14   %LET V=A B; 15   %PUT &&&V &&&&A; SYMBOLGEN:  && resolves to &. SYMBOLGEN:  Macro variable V resolves to A B SYMBOLGEN:  Macro va...

103.INPUT | ABSOLUTE | LAG | LOG | LOG10 | MOD | DIF OPTIONS

  INPUT | ABSOLUTE | LAG | LOG | LOG10 | MOD | DIF OPTIONS DATA NEW; INPUT NUM; CARDS; 34.12 56.15 89.34 14.32 -32.15 ; RUN; PROC PRINT; RUN; OUTPUT: Obs NUM 1 34.12 2 56.15 3 89.34 4 14.32 5 -32.15 /*/*ABSOLUTE GIVE '-' NUMBERS TO '+' NUMBERS*/*/; /*/*LAG GETS PREVIOUS VARIABLE */*/ /*/*LOG MEANS LOGARITHM AND LOG10 ALSO*/* /*/*MOD MEANS DIVISION BY OUR NUMBER/*/*/ /*/*DIF MEANS SUBSTRACTION*/*/; DATA MATH; SET NEW; INT=INT(NUM); ABS=ABS(NUM); LAG=LAG(NUM); LOG=LOG(NUM); LOG1=LOG10(NUM); MOD=MOD(NUM,5); DIF=DIF(NUM); RUN; PROC PRINT; RUN; OUTPUT: Obs NUM INT ABS LAG LOG LOG1 MOD DIF 1 34.12 34 34.12 . 3.52988 1.53301 4.12 . 2 56.15 56 56.15 34.12 4.02803 1.74935 1.15 22.03 3 89.34 89 89.34 56.15 4.49245 1.95105 4.34 33.19 4 14.32 14 14.32 89.34 2.66166 1.15594 4.32 -75.02 5 -32.15 -32 32.15 14.32 . . -2.15 -46.47 TRY AND COMMENT YOUR CODE... -->PLEASE READ AND COMMENT THE BLOG... --PLEAS...

102.ABSOLUTE | SQUAREROOT | EXPONENT | NATURAL OPTIONS

  ABSOLUTE | SQUAREROOT | EXPONENT | NATURAL  OPTIONS DATA NEW; INPUT Z; ABSOLUTE=ABS(Z); SQUARE=SQRT(ABSOLUTE); EXPONENT=EXP(ABSOLUTE); NATURAL=LOG(ABSOLUTE); F=Z**5; CARDS; 1 -5 6 8 ; RUN; PROC PRINT; RUN; OUTPUT: Obs Z ABSOLUTE SQUARE EXPONENT NATURAL F 1 1 1 1.00000 2.72 0.00000 1 2 -5 5 2.23607 148.41 1.60944 -3125 3 6 6 2.44949 403.43 1.79176 7776 4 8 8 2.82843 2980.96 2.07944 32768 TRY AND COMMENT YOUR CODE... -->PLEASE READ AND COMMENT THE BLOG... --PLEASE FOLLOW THE BLOG FOR MORE UPDATES... --FOLLOW US IN FACEBOOK SASALL4YOU AND JOIN ... --JOIN US IN FACEBOOK AND TELEGRAM  CHANNEL FOR MORE UPDATES    CLICK HERE :  https://t.me/SasAll4You

101.FIND | COMPARE | VERIFY | AMPERSAND & | PROPCASE | SUBSTR | INDEX FUNCTIONS

FIND | COMPARE | VERIFY | AMPERSAND & | PROPCASE | SUBSTR | INDEX FUNCTIONS  DATA A1; A='Further, the company emphasized that much Further'; B=FIND(A,'PANY','I'); C=COMPARE(A,'that'); D='Further, the company emphasized that much'; E=FIND(A,'the'); F=FIND(A,'Fur',4); G=VERIFY(A,D); RUN; PROC PRINT; RUN; OUTPUT: Obs A B C D E F G 1 Further, the company emphasized that much Further 17 -1 Further, the company emphasized that much 4 43 0 DATA A2; A='ABCJHDLABC'; B='ABCDKJDF'; C=VERIFY(B,A); RUN; PROC PRINT; RUN; OUTPUT: Obs A B C 1 ABCJHDLABC ABCDKJDF 5 DATA A3; INPUT NAME&$ 30.; CARDS; Kamireddy jagan reddy   adithya desh pandey   ankit patel rathod  ; RUN; PROC PRINT; RUN; OUTPUT: Obs NAME 1 Kamireddy jagan reddy 2 adithya desh pandey 3 ankit patel rathod DATA A4; SET A3; A=PROPCASE(NAME); B=SUBSTR(A,1,1); C=INDEX(A,' '); D=SUBSTR(A,C); FNAME=STRIP(B)||'...

100.TRANWRD | INDEX | INDEXW | COMPRESS | COMPBL | STRIP | TRIM | CAT | CATX FUNCTIONS

 TRANWRD | INDEX | INDEXW | COMPRESS | COMPBL | STRIP | TRIM | CAT | CATX FUNCTIONS DATA A0; A='Kamireddy jagan reddy'; B='adithya desh pandey'; C='ankit patel rathod'; D=TRANWRD(A,'Kamireddy jagan reddy','K.Jagan Reddy'); E=TRANWRD(B,'adithya desh pandey','A.Desh Pandey'); F=TRANWRD(C,'ankit patel rathod','A.Patel Rathod'); RUN; PROC PRINT; RUN; OUTPUT: Obs A B C D E F 1 Kamireddy jagan reddy adithya desh pandey ankit patel rathod K.Jagan Reddy A.Desh Pandey A.Patel Rathod DATA A1; A='          THIS     IS     A     CALCULATOR     '; B=INDEX(A,'H'); C=INDEXW(A,'IS'); D=COMPRESS(A,'C'); E=COMPBL(A); RUN; PROC PRINT; RUN; OUTPUT: Obs A B C D E 1 THIS IS A CALCULATOR 12 20 THIS IS A ALULATOR THIS IS A CALCULATOR DATA A2; A='     THIS       IS      A      CALCULATOR    '; F=RIGHT(A); G=LEFT(A); H...