This piece of conditional code executes a different PUT _ODS_ statement for each of three conditions. If BUSINESS_PHONE is missing, the PUT statement writes values for LAST_NAME, FIRST_NAME, and BUSINESS_PHONE (the columns that are defined in the ODS= option) into the output buffer. It then writes the value for HOME_PHONE in column 3, overwriting the missing value of BUSINESS_PHONE.

If HOME_PHONE is missing, the PUT statement simply writes values for LAST_NAME, FIRST_NAME, and BUSINESS_PHONE to the buffer.


Finally, if both phone numbers have values, the PUT statement writes values for LAST_NAME, FIRST_NAME, and BUSINESS_PHONE to the buffer in the first line. It then goes to the next line (as directed by the line pointer control / ) and writes the value of HOME_PHONE in the third column of the next line.


if (missing(business_phone)) then
   put _ods_ @3 home_phone;
else if (missing(home_phone)) then 
   put _ods_;
else
   put _ods_ / @3 home_phone;
run;