column value from column name

Get column value from column name

There are times when we need to use the attributes like the column value from the column name or format of a variable within a data set. The VValue and Vvaluex functions can be used to return the format and/or value of a variable or a string within the data step.

Custom sort order in sas

Creating a custom sort order in SAS

Sometimes, we prefer to sort variables manually with a custom sort order rather than alphabetically or Numerical sequence.The first solution is to create user-defined formats that map the DelayCategory to a number that represents the order in which the records will appear.

Often Programmers are required to find if an object exists in SAS for validation or to execute certain codes dynamically. This article will help you to find if a specific object exists in SAS. The types of objects include datasets, external files, open libraries, file references, macros, macro variables, formats, informats, and specific variables in a dataset.

Check if a Specified Object Exists

Often Programmers are required to find if an object exists in SAS for validation or to execute certain codes dynamically. This article will help you to find if a specific object exists in SAS. The types of objects include datasets, external files, open libraries, file references, macros, macro variables, formats, informats, and specific variables in a dataset.

specify list of variables in sas

How To Specify List Of Variables In SAS?

In SAS, you can quickly specify a list of variables in SAS statements like KEEP and DROP statements, the ARRAY statement, and the OF operator for comma-separated arguments to some functions. You can also …

Read more

6 methods to reorder Variables in SAS Data Set

6 methods to reorder Variables in SAS Data Set

In SAS, the order of variables in a data set is based on the order in which the variables were created. There are several reasons you may want to reorder variables names in a SAS data set. You can change the position of a variable in a SAS dataset with any of the following statements. ATTRIB, ARRAY, FORMAT, INFORMAT, LENGTH, and RETAIN.

Changing the Case of All Character Variables in a Data Set

Changing the Case of All Character Variables in a Data Set

This program will change the case for all of the character variables in a SAS data set. The key here is using the _CHARACTER_ keyword in the ARRAY statement. This will create an array of all the character variables in the dataset.

Count of missing and nonmissing values for each variable in a SAS data set

Count missing and Non-missing values for each variable – In SAS, we often need to get the count of missing and non-missing values in a SAS dataset. The code used in this example uses PROC FORMAT to create the format for character and numeric variables to be either “non-missing” or “missing” and then use that format with PROC FREQ.

How to create folders in SAS?

How to create folders using SAS?

To create folders in SAS, there are a variety of system options, functions, and commands that you can use.  These tools can be automated to perform repetitive routine tasks and which avoid manual work and save a great deal of time.