Type : CREATION_INTERNE
The macro performs code generation and string manipulation. It does not read any data tables.
| 1 | %macro _bwhen/parmbuff; |
| 2 | |
| 3 | %local i j; |
| 4 | |
| 5 | %*put SYSPBUFF=&syspbuff; |
| 6 | |
| 7 | %let j=%_count(&syspbuff, split=%str(,())); |
| 8 | |
| 9 | when(%DO i=1 %to &j; |
| 10 | %_list(%qscan(&syspbuff, &i, %str(,())), split=%str(,)) %IF &i<&j %THEN ,; |
| 11 | %END;) |
| 12 | |
| 13 | %mend _bwhen; |
| 1 | /* Exemple de validation (commenté dans la source) */ |
| 2 | DATA _null_; |
| 3 | |
| 4 | hcpcs_cd='63279'; |
| 5 | |
| 6 | select(hcpcs_cd); |
| 7 | %_bwhen('22100', '22110', '22318', '22319', '22326', '22548', |
| 8 | '22590', '22595', '61343', '63180', '63182', '63194', '63196', '63198', |
| 9 | '63250', '63265'-'63285', '63300', '63304') ex15=1; |
| 10 | otherwise; |
| 11 | END; |
| 12 | |
| 13 | put ex15=; |
| 14 | RUN; |