I got the below interesting codes (How to split one dataset to many) in the web and have added some codes on it (with ADDED). I have got the following message when i run the below program. Invalid argument 5 to function CAT. Missing values may be generated. Further warning from this call to CAT will be suppressed. Anyone can help? or have a better way? %let TABLE=sashelp.cars; %let COLUMN=origin; proc sql; select distinct ORIGIN into :valList separated by ',' from SASHELP.CARS; quit; proc sql; /* build a mini program for each value */ /* create a table with valid chars from data value */ select distinct cat("DATA out_",compress(&COLUMN.,,'kad'), "; set &TABLE.(where=(&COLUMN.='", &COLUMN., "')); IF TYPE EQ 'SUV' THEN CHECK = INVOICE*1.06; ****ADDED*** IF TYPE EQ 'Sports' THEN CHECK = INVOICE*1.1; ***ADDED*** IF TYPE EQ 'Truck' THEN CHECK = INVOICE*1.12; ****ADDED*** IF TYPE EQ 'Sedan' THEN CHECK = INVOICE*1.14; ****ADDED*** run;") into :allsteps separated by ';' from &TABLE.; quit; /* macro that includes the program we just generated */ %macro runSteps; &allsteps.; %mend; /* and...run the macro when ready */ %runSteps;
... View more