There are few statements in excel which has to be read into SAS and converted in to SAS dataset and in turn these statements should be converted into SAS executable statements. Below are 3 different statements written in excel which has to be converted into SAS logical statements while passing into data step it should be executed without any errors/warnings.
Scenario1: else variable = concat(values=var1 " (" var2 ")", delimiter=''); Scenario2: else variable= concat( values = var1 " (" var2 ")",delimiter=''); Scenario3: concat(values =name1 text2 var3 variable4 temp5, delimiter="; ");
output1 to execute in sas statement: else variable=catt(var1, " (", var2, ")");
output2 to execute in sas statement: catt(name1, text2, var3, variable4, temp5); These values are separated by semicolon and space.
In all of the scenarios we have to concatenate the variables present in the values parameter and these should be separated by delimiter as specified in the statement.Moreover all the variables should be stripped as well, to avoid leading and trailing blanks while concatenating. In scenario 1 and 2 the variables are separated by space as delimiter and in scenario 3 the values are separated by semicolon and space as delimiter. Another challenge in excel statements there may be unequal spaces before/after values and delimiter , these has to be controlled in SAS executable statements to avoid unwanted errors/warnings.
The CATT can be any of the CAT functions, i have used CATT here temporarily. I have tried with TRANWRD, SCAN, SUBSTR,COMPRESS fucntions to make those SAS executable statements while parsing in data step.Any suggestions/comments greatly appreciated.
... View more