mercredi 7 octobre 2015

If then output not working in UNIX SAS

Piece of code on Unix Server is not working, but works on PC SAS. When executed in UNIX SAS, the output datasets pc_pf_yes_1 and pc_pf_no_1 both have 0 observations, but no error is observed. In PC SAS, the code works fine and populates the datasets as intended.

The below datastep is within a macro.

data pc_pf_yes_1 pc_pf_no_1;
    set pc_&month._2;
    if primary_flag = "Y" then output pc_pf_yes_1;
    else if primary_flag = "N" then output pc_pf_no_1;
run;

primary_flag is a binary variable with values Y and N, stored as a string length 1. &month. is a macro variable that stores a month name for data selection.

Is there a quirk with UNIX SAS within a macro that I don't know about?

Aucun commentaire:

Enregistrer un commentaire