Using Permanently Assigned Labels and Formats

When you use a LABEL or FORMAT statement within a PROC step, the label or format applies only to the output from that step.
However, in PROC steps, you can also use permanently assigned labels or formats. Permanent labels and formats can be assigned in the DATA step. These labels and formats are saved with the data set, and they can be reused by procedures that reference the data set.
For example, the DATA step below creates Flights.March and defines a format and label for the variable Date. Because the LABEL and FORMAT statements are inside the DATA step, they are written to the Flights.March data set and are available to the subsequent PRINT procedure.
data sasuser.paris;
set sasuser.laguardia;
   where dest="PAR" and (boarded=155 or boarded=146);
   label date=’Departure Date’;
   format date date9.;
run;

proc print data=sasuser.paris label date='Departure Date';
   var date dest boarded;   
run;
Figure 5.29 Using Permanent Labels and Formats
Using Permanent Labels and Formats
Notice that the PROC PRINT statement still requires the LABEL option in order to display the permanent labels. Other SAS procedures display permanently assigned labels and formats without additional statements or options.
For more information about permanently assigning labels and formats, see Creating and Managing Variables.
Last updated: January 10, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.78.136