SAS Developer
-
SAS Date Functions:- DATEPART( ), TIMEPART( ), Hour(), Minute(), Second() Part1
In SAS, the DATEPART() and TIMEPART() functions are used to extract the date and time parts from datetime values, respectively. Here’s how each function works: 1. DATEPART(): The DATEPART() function extracts the date part from a datetime value and returns it as a date value. This function is particularly useful when you have datetime values…
-
SAS Character Functions, Date Functions
here’s a table summarizing some common SAS List Date functions with their syntax and examples: Here’s a breakdown of some key categories with representative functions, syntax, and examples: 1. Retrieving Dates: Function Syntax Description Example…
-
SAS First., Last. Syntax and uses with examples
In SAS, the FIRST. and LAST. automatic variables are used within a DATA step to identify the first and last occurrences of observations within a BY group. These variables are particularly useful when working with sorted data or when you need to perform specific operations on the first or last observation of a group. Here’s…
-
Syntax and Uses of PROC steps such as PRINT, SORT, FREQ, MEANS, SUMMARY, and SQL
1. PROC PRINT: 2. PROC SORT: PROC SORT is used to rearrange the observations in a SAS dataset in ascending or descending order based on the values of specified variables. Syntax: PROC SORT DATA=input_dataset OUT=output_dataset; BY variable1 <(ASCENDING|DESCENDING)> <… variableN <(ASCENDING|DESCENDING)>>;RUN; Example: Suppose we have a dataset named sales with variables Product_ID, Date, and Revenue.…
-
Explain SAS PDV step by step with a example
The Program Data Vector (PDV) is a critical concept in SAS programming, particularly in the context of the DATA step. It represents the current state of data processing during the execution of a DATA step. Let’s delve into how the SAS PDV works in detail: 1. Compilation Phase: 2. Execution Phase: 3. Statement Execution: 4.…
-
SAS Reading and writing data- Important Points and Interview Question and Answers
SAS: Reading and Writing Data – Important Points and Interview Q&A Important Points: Sample Code (Reading CSV): SAS Sample Code (Writing to CSV): SAS Interview Questions and Answers: By understanding these points and practicing with sample code, you can effectively answer interview questions related to reading and writing data in SAS. Remember to adapt your…