Type : CREATION_INTERNE
Die verarbeiteten Daten stammen aus der Standardausgabe (stdout) eines über eine Pipe ausgeführten Systembefehls. Es werden keine externen SAS-Tabellen gelesen.
| 1 | %IF &lmacro=q %THEN |
| 2 | %DO; |
| 3 | %AHGsubmitrcommand(cmd=&rcommand); |
| 4 | %goto exit; |
| 5 | %END; |
| 6 | |
| 7 | %syslput rcommand=%bquote(&rcommand); |
| 8 | %syslput lmacro=&lmacro; |
| 9 | %syslput rmycmd=&rcommand; |
| 10 | %syslput rformat=%str(&FORMAT); |
| 11 | %syslput rdlm=%str(&dlm); |
| 12 | %syslput rpiperesult=; |
| 1 | rsubmit; |
| 2 | |
| 3 | DATA _null_; |
| 4 | filename pip pipe "ksh -c %str(%')%bquote(. ~liu04/bin/myalias; PATH=/home/liu04/bin:/opt/sasprod:/usr/sbin:/etc:/usr/local/bin:/usr/bin:/bin:/usr/dt/bin:/usr/openwin/bin:/usr/ucb:.:/home/liu04/bin/perl;FPATH=/home/liu04/bin;)&rmycmd %str(%') " ; |
| 5 | INFILE pip truncover lrecl=32767; |
| 6 | LENGTH file $32767; |
| 7 | INPUT file 1-32767; |
| 8 | myfile=put(translate(file,"&rdlm",byte(12)),&rformat); |
| 9 | call symput("rpiperesult",trim(compbl(myfile))); |
| 10 | RUN; |
| 11 | %put lmacro=&lmacro; |
| 12 | %nrstr(%%)sysrput &lmacro=%nrbquote(&rpiperesult); |
| 13 | endrsubmit; |
| 1 | %IF %LENGTH(&&&lmacro) %THEN %let &lmacro=%sysfunc(translate(&&&lmacro,%str( ),%sysfunc(byte(12)))); |
| 2 | |
| 3 | |
| 4 | %IF %upcase(&PRINT)=YES %THEN %put %nrbquote(&&&lmacro); |