%macro imprim(file=,LS=,PS=,rotate=portrait,pageno=); /* Macro écrite par Patrick Brossier (GIP RECLUS) file filename du fichier dans lequel seront déroutées les impression ls nombre de caractères par ligne ps nombre de ligne par page rotate orientation de la page -> portrait = à la française -> paysage = à l'italienne pageno numéro de la première page La macro %imprim commence le déroutage vers un fichier et la macro %fimprim termine ce déroutage et rétablit les paramètres modifiés Macros utilisées: %temp Version du 28/11/03 */ %global tempo temp typetemp; %temp; %let tempo=&temp;%let n=&typetemp; %if &file= %then %do; %if &SYSSCP=MAC %then filename imprim "~'>>>>':SASImprim";; %if &SYSSCP=WIN %then %do; %window open rows=12 columns=68 #3 @5 "Nom du fichier:" color=red @32 filed 44 color=red attr=underline required=yes auto=yes #5 @5 "Commande " "END" color=green attr=highlight @26 "CANCEL" #6 @5 " " "SUBMIT" color=green attr=highlight @26 "OK"; %disp: %display open delete; %let cmd=%upcase(&syscmd); %if &cmd=END %then %goto fin; %if &cmd^= && &cmd^=SUBMIT %then %do; %let sysmsg=Commande inconnue (SUBMIT END); %goto disp; %end; filename imprim %quote("&filed"); %end; %let file=imprim; %end; %if %UPCASE(&rotate)=PORTRAIT %then %do; %if &ls= %then %let ls=95; %if &ps= %then %let ps=70; %end; %else %do; %if &ls= %then %let ls=132; %if &ps= %then %let ps=55; %end; proc printto log=%quote("&tempo.logsas") new; proc options option=pagesize short; proc options option=linesize short; %if &pageno^= %then proc options option=pageno short;; proc printto;run; OPTIONS DATE NUMBER LS=&LS PS=&PS %if &pageno^= %then pageno=&pageno;; proc printto print=&file new; run; %fin:%mend; %macro fimprim; %global tempo; proc printto; run; data _null_; infile %quote("&tempo.logsas") ; file %quote("&tempo.tempoi2"); length ligne $ 132; input ligne; if index(ligne,'SIZE')^=0 ! index(ligne,'PAGENO')^=0; put ligne; run; options %inc %quote("&tempo.tempoi2"); ;run; %mend;