The EXPAND Procedure

Creating New Variables

You can use the CONVERT statement to name a new variable to contain the results of the conversion. Using this feature, you can create several different versions of a series in a single PROC EXPAND step. Specify the new name after the input variable name and an equal sign:

   convert variable=newname ... ;

For example, suppose you are converting quarterly data to monthly and you want both first-of-month and midmonth estimates for a beginning-of-period variable X. The following statements perform this task:

   proc expand data=a out=b 
               from=qtr to=month;
      id date;
      convert x=x_begin / observed=beginning;
      convert x=x_mid   / observed=(beginning,middle);
   run;