call macro present in another SAS code

Today, I will discuss about How to call macro whose code is present in another SAS script. First, we need to understand why another SAS script is required. Answer to this is very simple that is redundant code. Many a times, particular portion of code is used in many SAS scripts like getting today’s date or yesterday’s date or yesterday’s month or year. For this , It is recommended to write a separate code and call that code in the existing script.Here, I have created two SAS Scripts. FIRST SCRIPT…

equivalent of sum of columns in SAS

Today, I will discuss about “How to design SAS code which is equivalent of sum of columns in database. Consider the below employee details. In order to get sum of Year-2019 and Year-2020, we need to use add (+) operator to achieve the same. See the below Query and data for the same. Here, i applied ,normal addition, sum using ISNULL function, difference using absolute(ABS) function. In order to achieve the same in SAS . Create the same Datasets . See the below Screen Shot for the same. Now, create…

features of SAS Tool

Today, I will discuss about the features of SAS. As I started my career as database developer ,hence I will share features which is similar to database commands which will help you all in migration projects. 1. Connect to any data base like Sql-server , Netezza, Oracle using connect to odbc command.2. Perform nesting of SAS scripts inside one SAS script using macro and include commands.3. Perform union all, all joins(left outer,right outer,full outer) operations in SAS using merge and set commands4. Read data from any file like csv ,pipe(|)…

equivalent of union all in SAS

Today , I will discuss about ” How to code in SAS which is equivalent of union all in Database.See the below Data set in Sql Server. See the output of union all in Sql Server Perform the same Steps for SAS as well. First, create the same data set in SAS. Below code will perform union all logic in SAS.* Tricky part here is renaming of columns , otherwise data will not look alike that of sql server. See the SAS output for the same.

equivalent of full outer join in SAS

Today, I will discuss about “How to design SAS code which is equivalent of full outer join in database”. We created the two datasets in sql-server. when we apply full outer join on above data set. In SAS, create the dataset same as TEST1 and TEST2 tables.* Always remember to sort the data. Make a habit of this in SAS. Merge the above datasets using the below code. See the final output for the same.