I have rebuilt the program like this : data _null_;
mois = month(input("&sysdate9",date9.));
annee = year(input("&sysdate9",date9.));
jour = day(input("&sysdate9",date9.));
call symput('mois',compress(put(mois,Z2.)));
call symput('annee',compress(put(annee,best.)));
call symput('jour',compress(put(jour,Z2.)));
call symputx('lien','\\batd0\bases_rad\ficovie\');
call symputx('fichier','_ACTEURXXX');
call symputx('extension','.xlsx');
run;
%put &annee &mois &jour &lien &fichier &extension ;
proc sort data=work.refec9; by acteur;
data _null_;
set work.refec9;
call symputx('acteur00','MOA Reglementaire');
call symputx('acteur01','MOE FICOVIE');
call symputx('acteur02','Gestion Pegase');
call symputx('acteur03','Gestion 8X');
call symputx('acteur04','Gestion PTV');
call symputx('acteur05','Gestion Espece');
call symputx('acteur06','Gestion Obseques');
call symputx('acteur07','Gestion BIGBEN');
call symputx('header','numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper');
/*
%let lien=\\batd0\bases_rad\ficovie\;
%let fichier='_ACTEURXXX';
%let acteur00='MOA Reglementaire';
%let acteur01='MOE FICOVIE';
%let acteur02='Gestion Pegase';
%let acteur03='Gestion 8X';
%let acteur04='Gestion PTV';
%let acteur05='Gestion Espece';
%let acteur06='Gestion Obseques';
%let acteur07='Gestion BIGBEN';
%let header='numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper';
*/
by acteur;
if FIRST.acteur then do;
title &header;
if acteur=&acteur00 then do;
file "&lien&annee&mois&jour&acteur00&extension" filevar=refec9 mod;
put numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper;
end;
else
if acteur=&acteur01 then do;
file "&lien&annee&mois&jour&acteur01&extension" filevar=refec9 mod;
put numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper;
end;
end;
run; SAS can't be read the variable "acteurXX" if there is a space on the value ... But in my table variable own a space it's a constraint. Each time the second word after the space it's recognized by SAS, and SAS underline this like an error . The instruction file refuse all paramaters that I can give . I don't see why this function refuse all parameters ???!!! data _null_;
set work.refec9;
call symputx('acteur00','MOA Reglementaire');
call symputx('acteur01','MOE FICOVIE');
call symputx('acteur02','Gestion Pegase');
call symputx('acteur03','Gestion 8X');
call symputx('acteur04','Gestion PTV');
call symputx('acteur05','Gestion Espece');
call symputx('acteur06','Gestion Obseques');
call symputx('acteur07','Gestion BIGBEN');
call symputx('header','numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper');
/*
%let lien=\\batd0\bases_rad\ficovie\;
%let fichier='_ACTEURXXX';
%let acteur00='MOA Reglementaire';
%let acteur01='MOE FICOVIE';
%let acteur02='Gestion Pegase';
%let acteur03='Gestion 8X';
%let acteur04='Gestion PTV';
%let acteur05='Gestion Espece';
%let acteur06='Gestion Obseques';
%let acteur07='Gestion BIGBEN';
%let header='numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper';
*/
by acteur;
if FIRST.acteur then do;
title &header;
if acteur=&acteur00 then do;
file "&lien&annee&mois&jour&acteur00&extension" filevar=refec9 mod;
put numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper;
end;
else
if acteur=&acteur01 then do;
file "&lien&annee&mois&jour&acteur01&extension" filevar=refec9 mod;
put numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper;
end;
end;
run; SAS log : NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR 22 23 GOPTIONS ACCESSIBLE; 24 data _null_; 25 26 mois = month(input("&sysdate9",date9.)); SYMBOLGEN: Macro variable SYSDATE9 resolves to 24NOV2017 27 annee = year(input("&sysdate9",date9.)); SYMBOLGEN: Macro variable SYSDATE9 resolves to 24NOV2017 28 jour = day(input("&sysdate9",date9.)); SYMBOLGEN: Macro variable SYSDATE9 resolves to 24NOV2017 29 call symput('mois',compress(put(mois,Z2.))); 30 call symput('annee',compress(put(annee,best.))); 31 call symput('jour',compress(put(jour,Z2.))); 32 /**/ 33 call symputx('lien','\\batd0\bases_rad\ficovie\'); 34 call symputx('fichier','_ACTEURXXX'); 35 call symputx('extension','.xlsx'); 36 run; NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 37 38 %put &annee &mois &jour &lien &fichier &extension ; SYMBOLGEN: Macro variable ANNEE resolves to 2017 SYMBOLGEN: Macro variable MOIS resolves to 11 SYMBOLGEN: Macro variable JOUR resolves to 24 SYMBOLGEN: Macro variable LIEN resolves to \\batd0\bases_rad\ficovie\ SYMBOLGEN: Macro variable FICHIER resolves to _ACTEURXXX SYMBOLGEN: Macro variable EXTENSION resolves to .xlsx 2017 11 24 \\batd0\bases_rad\ficovie\ _ACTEURXXX .xlsx 39 2 The SAS System 09:00 Friday, November 24, 2017 40 GOPTIONS NOACCESSIBLE; 41 %LET _CLIENTTASKLABEL=; 42 %LET _CLIENTPROJECTPATH=; 43 %LET _CLIENTPROJECTNAME=; 44 %LET _SASPROGRAMFILE=; 45 46 ;*';*";*/;quit;run; 47 ODS _ALL_ CLOSE; 48 49 50 QUIT; RUN; and the second part : NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR 22 23 GOPTIONS ACCESSIBLE; 24 proc sort data=work.refec9; by acteur; 25 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.00 seconds 26 data _null_; 27 28 set work.refec9; 29 30 call symputx('acteur00','MOA Reglementaire'); 31 call symputx('acteur01','MOE FICOVIE'); 32 call symputx('acteur02','Gestion Pegase'); 33 call symputx('acteur03','Gestion 8X'); 34 call symputx('acteur04','Gestion PTV'); 35 call symputx('acteur05','Gestion Espece'); 36 call symputx('acteur06','Gestion Obseques'); 37 call symputx('acteur07','Gestion BIGBEN'); 38 call symputx('header','numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut 38 ! analyse_gestion analyse_moe date_derniere_modif lid rolper numper'); 39 /* 40 %let lien=\\batd0\bases_rad\ficovie\; 41 %let fichier='_ACTEURXXX'; 42 %let acteur00='MOA Reglementaire'; 43 %let acteur01='MOE FICOVIE'; 44 %let acteur02='Gestion Pegase'; 45 %let acteur03='Gestion 8X'; 46 %let acteur04='Gestion PTV'; 47 %let acteur05='Gestion Espece'; 48 %let acteur06='Gestion Obseques'; 2 The SAS System 09:00 Friday, November 24, 2017 49 %let acteur07='Gestion BIGBEN'; 50 %let header='numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion 50 ! analyse_moe date_derniere_modif lid rolper numper'; 51 */ 52 53 by acteur; 54 55 if FIRST.acteur then do; SYMBOLGEN: Macro variable HEADER resolves to numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion analyse_moe date_derniere_modif lid rolper numper 56 title &header; SYMBOLGEN: Macro variable ACTEUR00 resolves to MOA Reglementaire SYMBOLGEN: Macro variable LIEN resolves to \\batd0\bases_rad\ficovie\ SYMBOLGEN: Macro variable ANNEE resolves to 2017 SYMBOLGEN: Macro variable MOIS resolves to 11 SYMBOLGEN: Macro variable JOUR resolves to 24 SYMBOLGEN: Macro variable ACTEUR00 resolves to MOA Reglementaire SYMBOLGEN: Macro variable EXTENSION resolves to .xlsx ERROR: A Physical file reference (i.e. "PHYSICAL FILE REFERENCE" ) or an aggregate file storage reference (i.e. AGGREGATE(MEMBER) ) reference cannot be used with the FILEVAR= option. 57 if acteur=&acteur00 then do; NOTE: Line generated by the macro variable "ACTEUR00". 57 MOA Reglementaire _____________ 388 76 ERROR 388-185: Expecting an arithmetic operator. ERROR 76-322: Syntax error, statement will be ignored. 58 file "&lien&annee&mois&jour&acteur00&extension" filevar=refec9 mod; 59 put numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion 59 ! analyse_moe date_derniere_modif lid rolper numper; SYMBOLGEN: Macro variable ACTEUR01 resolves to MOE FICOVIE 60 end; 61 else SYMBOLGEN: Macro variable LIEN resolves to \\batd0\bases_rad\ficovie\ SYMBOLGEN: Macro variable ANNEE resolves to 2017 SYMBOLGEN: Macro variable MOIS resolves to 11 SYMBOLGEN: Macro variable JOUR resolves to 24 SYMBOLGEN: Macro variable ACTEUR01 resolves to MOE FICOVIE SYMBOLGEN: Macro variable EXTENSION resolves to .xlsx 62 if acteur=&acteur01 then do; ERROR: A Physical file reference (i.e. "PHYSICAL FILE REFERENCE" ) or an aggregate file storage reference (i.e. AGGREGATE(MEMBER) ) reference cannot be used with the FILEVAR= option. NOTE: Line generated by the macro variable "ACTEUR01". 62 MOE FICOVIE _______ 388 76 ERROR 388-185: Expecting an arithmetic operator. ERROR 76-322: Syntax error, statement will be ignored. 63 file "&lien&annee&mois&jour&acteur01&extension" filevar=refec9 mod; 64 put numero_police application flux cause_evenement anomalie date_creation_rejet acteur statut analyse_gestion 64 ! analyse_moe date_derniere_modif lid rolper numper; 65 end; 3 The SAS System 09:00 Friday, November 24, 2017 ___ 161 66 end; ___ 161 ERROR 161-185: No matching DO/SELECT statement. 67 68 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 69 70 71 GOPTIONS NOACCESSIBLE; 72 %LET _CLIENTTASKLABEL=; 73 %LET _CLIENTPROJECTPATH=; 74 %LET _CLIENTPROJECTNAME=; 75 %LET _SASPROGRAMFILE=; 76 77 ;*';*";*/;quit;run; 78 ODS _ALL_ CLOSE; 79 80 81 QUIT; RUN; 82
... View more