Creating a Format from a Data Set in SAS Enterprise Guide
Within SAS Enterprise Guide a format can simply be created from an existing dataset. In this example a format is made to display the staff number as the employees name.
On the tool bar select Tasks -> Data -> Create Format from Data Set…
A window will appear, you will need to fill in the following:-
- Source data set - the dataset you would like to use to create your format;
- The format name – a name for the format (in this case Staff_Name);
- Format type – the data type of the variable to be formatted (Staffno is a character variable therefore a character format will need to be created);
- Value type – this is either discrete or a range. We are creating a discrete format as staffno is unique. If range was selected a start and end column would need to be chosen;
- Discrete values is the variable that contains the starting value;
- Labels is label you wish to generate.
Once you have specified the format details select Run.
When the properties of variable are selected, the format $STAFF_NAME appears under user defined formats.
The results below show that output when this format is applied to the staffno variable.