Ans: Base SAS is the foundation of the SAS programming language, providing data management, analysis, and reporting capabilities.
Ans: The main data types in SAS are numeric, character, and date/time.
Ans: A new variable can be created using the DATA step and the SET or INPUT statements.
Ans: The WHERE statement is used for subsetting observations, while the IF statement is used for conditional processing within a DATA step.
Ans: Missing values can be handled using the MISSING function, the IF-THEN statement, or the COALESCE function.
Ans: SAS formats are used to control the appearance of data values, while informats are used to read data values into SAS variables.
Ans: Both procedures calculate summary statistics, but PROC MEANS provides additional features like handling missing values and producing percentile statistics.
Ans: Data can be sorted using the SORT procedure or by using the SORT statement within a DATA step.
Ans: The RETAIN statement is used to retain the value of a variable across iterations of the DATA step.
Ans: Datasets can be merged using the MERGE statement or the SQL JOIN operation.
Ans: The LENGTH statement is used to assign the length of a variable in SAS.
Ans: SAS programs can be debugged using various techniques such as the PUT statement, the DEBUG option, and the SAS log.
Ans: SAS macro variables are created and manipulated using the %LET statement and are used to store and retrieve values during macro processing.
Ans: A macro variable can be created using the %LET statement or by assigning a value using a DATA step or a PROC SQL statement.
Ans: The ODS (Output Delivery System) statement is used to control the output destination and format of SAS output.
Ans: A SAS dataset is a physical file stored on disk, while a SAS view is a virtual dataset that is defined by a SAS program and does not store data itself.
Ans: Duplicate observations can be identified and handled using the SORT procedure with the nodupkey or nodup option.
Ans: The BY statement is used to group data and perform calculations within each group using procedures like PROC SORT and PROC MEANS.
Ans: SAS functions include numeric, character, date/time, and conversion functions, among others.
Ans: A permanent SAS dataset can be created using the DATA step and the LIBNAME statement to assign a permanent library.
Ans: Data can be imported from an external file into SAS using the INFILE statement or the IMPORT procedure.
Ans: A SAS data library is a collection of one or more SAS datasets that are stored together under a common name or location.
Ans: Data can be exported from SAS to an external file using the FILE statement or the EXPORT procedure.
Ans: PROC SQL provides a SQL interface within SAS and allows you to manipulate and query data using SQL syntax.
Ans: Random numbers can be generated in SAS using the RAND function or by using the RANUNI or RANNOR functions for uniform or normal distributions, respectively.