04-30-2018
azertyuiop
Quartz | Level 8
Member since
09-15-2017
- 68 Posts
- 18 Likes Given
- 2 Solutions
- 4 Likes Received
-
Latest posts by azertyuiop
Subject Views Posted 1441 04-30-2018 08:02 AM 1454 04-30-2018 05:02 AM 1545 04-27-2018 05:44 AM 1403 04-04-2018 04:26 AM 1458 04-03-2018 10:18 AM 4426 02-12-2018 04:06 AM 4323 02-08-2018 04:21 AM 4323 02-08-2018 04:17 AM 4361 02-07-2018 01:12 PM 4410 02-07-2018 11:06 AM -
Activity Feed for azertyuiop
- Got a Like for Re: proc sql send result count in macro. 03-15-2019 11:57 AM
- Liked Re: Noprint for Autoexec windows for mnjtrana. 04-30-2018 08:12 AM
- Liked Re: Noprint for Autoexec windows for mnjtrana. 04-30-2018 08:12 AM
- Got a Like for Re: Noprint for Autoexec windows. 04-30-2018 08:06 AM
- Posted Re: Noprint for Autoexec windows on SAS Enterprise Guide. 04-30-2018 08:02 AM
- Posted Re: Noprint for Autoexec windows on SAS Enterprise Guide. 04-30-2018 05:02 AM
- Posted Noprint for Autoexec windows on SAS Enterprise Guide. 04-27-2018 05:44 AM
- Posted Re: list of "eject" line after proc import on SAS Enterprise Guide. 04-04-2018 04:26 AM
- Posted list of "eject" line after proc import on SAS Enterprise Guide. 04-03-2018 10:18 AM
- Posted Re: Excel file to SAS , alt 0010 and ACSII on SAS Enterprise Guide. 02-12-2018 04:06 AM
- Posted Re: Excel file to SAS , alt 0010 and ACSII on SAS Enterprise Guide. 02-08-2018 04:21 AM
- Posted Re: Excel file to SAS , alt 0010 and ACSII on SAS Enterprise Guide. 02-08-2018 04:17 AM
- Posted Re: Excel file to SAS , alt 0010 and ACSII on SAS Enterprise Guide. 02-07-2018 01:12 PM
- Posted Excel file to SAS , alt 0010 and ACSII on SAS Enterprise Guide. 02-07-2018 11:06 AM
- Posted Re: condition OR transformed in a condition IN with call execute VS proc sql on SAS Enterprise Guide. 12-26-2017 09:19 AM
- Posted condition OR transformed in a condition IN with call execute VS proc sql on SAS Enterprise Guide. 12-26-2017 06:03 AM
- Posted Re: if error / switch / try catch on SAS Programming. 12-06-2017 03:20 AM
- Posted Re: if error / switch / try catch on SAS Programming. 12-05-2017 10:05 AM
- Posted Re: if error / switch / try catch on SAS Programming. 12-05-2017 04:23 AM
- Posted if error / switch / try catch on SAS Programming. 12-05-2017 03:47 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1 -
My Liked Posts
Subject Likes Posted 1 10-10-2017 10:11 AM 1 04-30-2018 08:02 AM 1 11-22-2017 05:40 AM 1 11-22-2017 05:07 AM
04-30-2018
08:02 AM
1 Like
Thanks for the help , it's excatly the article that I want found. Thanks for your help. I keep a copy of article
... View more
04-30-2018
05:02 AM
Hello , Good morning Manjeet , I see your proposition with the function but it's not realy the subject in my case. I note the solution with "printto". In my case it's this (a picture it's better than a long description ) : Like on this picture the programm "launch" in "Autoexec" , generates a message box with "yes" or "no" to start automaticaly the launch program. In my case I want that this box click on "yes" automaticaly without the appear of this message box. Thanks Hello from France
... View more
04-27-2018
05:44 AM
Hello , Good morning , I use a SAS program under SAS Guide. When my program start there is windows during the launching of "Autoexec". It's possible to desactivated in parameter the view of "Autoexec" with "OK" button ? There is a no print command for the Autoexec ? Thanks for your help
... View more
04-04-2018
04:26 AM
Hello , Good morning , I didn't think that it's possible to build a system with 2 tables. I did think that it's necessary to find a table like the table "vcolumn" which own all information about all table under current SAS session. I will adapt the system that you propose with a proc import. Thanks for your solution.
... View more
04-03-2018
10:18 AM
Hello I have tested a proc import under SAs with a CSV file. A numeric column contains several errors. For exemple a column of integer like "123456" , but there is unauthorized caracterse like "123-456" or "(123456)" . proc import DATAfile="\\serveur\dossier\fichier.csv" DBMS=csv OUTFILE=work.import REPLACE;
GETNAMES=no;
guessingrows=32767;
DELIMITER=";";
run; I compare the situation with Access. With Acces when we import data and there is a error , a table is created with the meam key of the line , to inform about the anomaly. With SAS it's possible to found a list with all line which are not accepted by system ? If it's possible with the log , because by moment it's not possible to see all line , only a part ... Thanks for your help .
... View more
02-12-2018
04:06 AM
Hello, After severals days to search the point of bug . This problem is fixed . I explain : 1) The excel files are generated by an other departement of the company. To generate the data and Excel file there is this in the this code before a prox export in excel : /* code sas */
proc transpose data=work.origine out=mytable(drop=_name_);
by firstkey ;
var secondkey ;
run;
data work.mytable;
set work.mytable;
length concat $7500. ;
format concat $7500. ;
informat concat $7500. ;
concat=catx('', of col:);
*drop col:;
run; For the second key it's impossible to know the number of appearance. Due to this sitution when the proc transpose is run the number of columns is random. When can obtain 10 columns like it's possible to obtain 50 columns. This line : concat=catx('', of col:); generates a "blank" or a "voide", and under Excel and SAS this it translate by a particular space. To fix this bug it's necessary to write a true space follow by a function tranwrd : concat=catx(' ', of col:);
concat=tranwrd(concat,'; ',';');
... View more
02-08-2018
04:21 AM
Hello , I have trying your solution with "compresse , and with array do , for Excel with '0D'x and '0A'x , it's the same result. When I see my data , there is again a "empty" caractere after the ";" . For CSV case I keep a note for a futur case if I have this case in the futur. In my case I'm limit with a Excel format , not a csv format.
... View more
02-08-2018
04:17 AM
Hello , I my case I can use only an Excel file.
... View more
02-07-2018
01:12 PM
Hello , You can see the format like on this picture : There are 5 departements in my company which work in a even structure of excel file. Each departement check severals informations in physical paper file . For each file the departement own a list of information into the field " comment_statut_idclient " to control the paper file. To reduce the quantity of line each department have decided to compact and group all information about one paper file in the same cell. In one cell it's a CSV format which is group. When I receive all Excel fils in SAS I must place each information about " comment_statut_idclient " , in one line with a copy of the rest of all data in the line. As I 'm not the leader of the process to decide the structure of data in Excel , I must adapt my process in Sas to cut the cell " statut " in several cells when it's necessary. To "help me" in the structure of data , I must locate the symbol ";" but I must to locate " alt 0010" which is just after the symbol ";" . If I don't find a solution to delete " alt 0010" , I can't tranform my data.
... View more
02-07-2018
11:06 AM
Hello, I own a Excel file with several columns to import in SAS . One column contains a concatenation with several under part with this caracters " ; " follow by " alt 0010" like barrier. To separate severals data in the under bloc I use a " | " : blabla1|statut1|numeropersonne1;blabla2|statut2|numeropersonne2;blabla3|statut3|numeropersonne3 In Excel , a user adds " alt 0010 " after " ; " to optimise the vision of data in the screen. When the excel file is import in SAS I use a macro to cut the under part. If there is 1 " ; " I must see 2 lines , 2 " ; " I must see 3 lines ets ... There is here a problem : After this symbol " ; " there is " alt 0010 " in the starting of next line After several checking : * with rank function , rank(field,1) dive 13 for the ASCII caracters type 13. * with the using of substr function in position 4 in the field start really here * with a count function in the field SAS say that the "alt 0010" is place on 2 caracters ... Can you help me to found a correct function to delete the "alt 0010 " in SAS ? Thanks for your help.
... View more
12-26-2017
09:19 AM
Hello , Thanks for the detection of error. I correct my parameter .
... View more
12-26-2017
06:03 AM
Hello , I have tried this SAS code : options compress=yes sortsize=max ;
/* bornage des dates pour les intervals de la date initiale de création */
%let bornemin = '01JAN2016:00:00:00';
%let bornemax = '30APR2016:00:00:00';
data _null_ ;
d_effet_debut=&bornemin;
d_effet_fin=&bornemax;
call execute(' proc sql ; ');
/* comptage détaillé en fonction de la nature d'evenement */
call execute(' create table resultat as ');
call execute(' select db_dossier.no_police , db_contrat.lp_contrat as type_sous , db_dossier.lp_etat_doss as etat_sousc , ');
call execute(' db_dossier.is_dossier , db_dossier.d_effet as effet_cont , db_contrat.lp_fiscalite ');
call execute(' from PEGASE.db_dossier , PEGASE.db_contrat ');
call execute(' where db_dossier.d_effet >="'!!d_effet_debut!!'" ' );
call execute(' and db_dossier.d_effet <"'!!d_effet_fin!!'" ');
call execute(' and ( db_dossier.lp_etat_doss in ( "OPEN" , "VALID" , "ANNUL" , "A30" , "RT" , "DCASS" ) ) ');
call execute(' and db_contrat.lp_contrat not like "TFERT" ' );
call execute(' and db_dossier.is_dossier = db_contrat.is_dossier ' );
call execute(' and ( ( db_contrat.lp_fiscalite not in ( "PERP" , "MADEL" ) ) or db_contrat.lp_fiscalite is NULL ) ' );
call execute(' order by db_dossier.no_police ' );
call execute(' ; ');
call execute(' run ; ');
run;
proc sql ;
create table resultat as
select db_dossier.no_police , db_contrat.lp_contrat as type_sous , db_dossier.lp_etat_doss as etat_sousc ,
db_dossier.is_dossier , db_dossier.d_effet as effet_cont , db_contrat.lp_fiscalite
from PEGASE.db_dossier , PEGASE.db_contrat
where db_dossier.d_effet >='01JAN2016:00:00:00'dt
and db_dossier.d_effet <'30APR2016:00:00:00'dt
and ( db_dossier.lp_etat_doss in ( "OPEN" , "VALID" , "ANNUL" , "A30" , "RT" , "DCASS" ) )
and db_contrat.lp_contrat not like "TFERT"
and db_dossier.is_dossier = db_contrat.is_dossier
and ( ( db_contrat.lp_fiscalite not in ( "PERP" , "MADEL" ) ) or db_contrat.lp_fiscalite is null )
order by db_dossier.no_police
;
run; When I use CALL execute the same sql query is invalid ... an "OR" condition is tranformed in " IN " condition . I don't know which is this problem or delirium ??? NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR 21 22 GOPTIONS ACCESSIBLE; 23 options compress=yes sortsize=max ; 24 25 /* bornage des dates pour les intervals de la date initiale de création */ 26 27 %let bornemin = '01JAN2016:00:00:00'; 28 %let bornemax = '30APR2016:00:00:00'; 29 30 data _null_ ; 31 32 d_effet_debut=&bornemin; 33 d_effet_fin=&bornemax; 34 35 call execute(' proc sql ; '); 36 37 /* comptage détaillé en fonction de la nature d'evenement */ 38 39 call execute(' create table resultat as '); 40 41 call execute(' select db_dossier.no_police , db_contrat.lp_contrat as type_sous , db_dossier.lp_etat_doss as etat_sousc , 41 ! '); 42 call execute(' db_dossier.is_dossier , db_dossier.d_effet as effet_cont , db_contrat.lp_fiscalite '); 43 call execute(' from PEGASE.db_dossier , PEGASE.db_contrat '); 44 call execute(' where db_dossier.d_effet >="'!!d_effet_debut!!'" ' ); 45 call execute(' and db_dossier.d_effet <"'!!d_effet_fin!!'" '); 46 call execute(' and ( db_dossier.lp_etat_doss in ( "OPEN" , "VALID" , "ANNUL" , "A30" , "RT" , "DCASS" ) ) '); 47 call execute(' and db_contrat.lp_contrat not like "TFERT" ' ); 48 call execute(' and db_dossier.is_dossier = db_contrat.is_dossier ' ); 49 call execute(' and ( ( db_contrat.lp_fiscalite not in ( "PERP" , "MADEL" ) ) or db_contrat.lp_fiscalite is NULL ) ' ); 50 call execute(' order by db_dossier.no_police ' ); 51 call execute(' ; '); 52 53 call execute(' run ; '); 54 2 The SAS System 11:27 Tuesday, December 26, 2017 55 run; NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.00 seconds NOTE: CALL EXECUTE generated line. 1 + proc sql ; 2 + create table resultat as 3 + select db_dossier.no_police , db_contrat.lp_contrat as type_sous , db_dossier.lp_etat_doss as etat_sousc , 4 + db_dossier.is_dossier , db_dossier.d_effet as effet_cont , db_contrat.lp_fiscalite 5 + from PEGASE.db_dossier , PEGASE.db_contrat 6 + where db_dossier.d_effet >="01JAN2016:00:00:00" 7 + and db_dossier.d_effet <"30APR2016:00:00:00" 8 + and ( db_dossier.lp_etat_doss in ( "OPEN" , "VALID" , "ANNUL" , "A30" , "RT" , "DCASS" ) ) 9 + and db_contrat.lp_contrat not like "TFERT" 10 + and db_dossier.is_dossier = db_contrat.is_dossier 11 + and ( ( db_contrat.lp_fiscalite not in ( "PERP" , "MADEL" ) ) or db_contrat.lp_fiscalite is NULL ) 12 + order by db_dossier.no_police 13 + ; ERROR: Expression using IN has components that are of different data types. NOTE: The IN referred to may have been transformed from an OR to an IN at some point during PROC SQL WHERE clause optimization. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. 14 + run ; NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect. 56 NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.04 seconds cpu time 0.00 seconds 57 proc sql ; 58 59 create table resultat as 60 61 select db_dossier.no_police , db_contrat.lp_contrat as type_sous , db_dossier.lp_etat_doss as etat_sousc , 62 db_dossier.is_dossier , db_dossier.d_effet as effet_cont , db_contrat.lp_fiscalite 63 from PEGASE.db_dossier , PEGASE.db_contrat 64 where db_dossier.d_effet >='01JAN2016:00:00:00'dt 65 and db_dossier.d_effet <'30APR2016:00:00:00'dt 66 and ( db_dossier.lp_etat_doss in ( "OPEN" , "VALID" , "ANNUL" , "A30" , "RT" , "DCASS" ) ) 67 and db_contrat.lp_contrat not like "TFERT" 68 and db_dossier.is_dossier = db_contrat.is_dossier 69 and ( ( db_contrat.lp_fiscalite not in ( "PERP" , "MADEL" ) ) or db_contrat.lp_fiscalite is null ) 70 order by db_dossier.no_police 71 ; NOTE: Compressing data set WORK.RESULTAT increased size by 33.33 percent. Compressed is 4 pages; un-compressed would require 3 pages. NOTE: Table WORK.RESULTAT created, with 3199 rows and 6 columns. 72 73 run; NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect. 74 Can you give me your opinion to solve this problem . Thnaks for your help ?
... View more
12-06-2017
03:20 AM
Hello / Good morning , I take a note for the format in CSV. It's better than Excel to import and control the quality of data. I know the option "guessingrows". I my case if I have used xls/xlsx format it's due to a command of severals departements in my company . In this departement the reference to work it's Excel and they refuse to use CSV/TXT format. You have reason when you say that the security to control with csv format is better en easier .
... View more
12-05-2017
10:05 AM
Hello / Good morning , It's not good idea to find a similar solution which is like in an other langage ? After severals hours I propose this solution : data _null_ ;
do i=1 to 5;
call execute (' data work.tp'!!cats(i)!!' ; ');
call execute (' set work.tp'!!cats(i)!!' ; ');
call execute (' length dtcorr2 8. ; ');
call execute (' format dtcorr2 date9. ; ');
call execute (' informat dtcorr2 date9. ; ');
call execute (' dtcorr2=input("Date correction"n,12.) ; ');
call execute (' length nopol2 coapp2 lbnateve2 lbcaueve2 anomalie2 lbact2 lbsta2 anages2 anamoe2 Lid2 $1500. ; ');
call execute (' format nopol2 coapp2 lbnateve2 lbcaueve2 anomalie2 lbact2 lbsta2 anages2 anamoe2 Lid2 $1500. ; ');
call execute (' informat nopol2 coapp2 lbnateve2 lbcaueve2 anomalie2 lbact2 lbsta2 anages2 anamoe2 Lid2 $1500. ; ');
call execute (' nopol2="N° Police"n ; ') ;
call execute (' coapp2=Application ; ') ;
call execute (' lbnateve2="Nature événement"n ; ') ;
call execute (' lbcaueve2="Cause événement"n ; ') ;
call execute (' anomalie2="Anomalie(s)"n ; ') ;
call execute (' lbact2=Acteur ; ') ;
call execute (' lbsta2=Statut ; ') ;
call execute (' anages2="Analyse Gestion"n ; ') ;
call execute (' anamoe2="Analyse MOE"n ; ') ;
call execute (' Lid2=Lead ; ') ;
call execute (' drop "Date correction"n ; ');
call execute ('run;');
end;
run;
data cinq_fichiers;
length fichier $100;
set
work.tp1 (in=a)
work.tp2 (in=b)
work.tp3 (in=c)
work.tp4 (in=d)
work.tp5 (in=e)
/*indsname=inds*/;
rename
nopol2=nopol
coapp2=coapp
lbnateve2=lbnateve
lbcaueve2=lbcaueve
anomalie2=anomalie
"Date rejet initial"n=dtcrerej
lbact2=lbact
lbsta2=lbsta
anages2=anages
anamoe2=anamoe
dtcorr2=dtcorr
Lid2=Lid;
/*fichier = inds;*/
if a then fichier="huitX_DECES_imp";
if b then fichier="huitX_imp";
if c then fichier="OBSEQUES_imp";
if d then fichier="PEGASE_DECES_imp";
if e then fichier="PEGASE_imp";
run; You can see a call execute with a loop because there are 5 tables and it's necessary to repeat the operation in my case . You want propose an other solution or you think that my program owns a risk ? You can give you solution 😄
... View more
12-05-2017
04:23 AM
Excel files in entrance in SAS program can own a great number of value , between 1000 to 10000 lines. I don't know by advance if the column "Date correction"n is empty or contain data. If the column "Date correction"n is empty SAS generates a text format , when sas detectes a value the format is date. In a second step I must union all table in one big table . In the present case "Date correction"n can own two format if the data is presented in the column. I want constrain SAS to own a only format > date format. Due to a specificities and technicals constraints I must use proc import , not a libname. The files excel in entrance are use by others programm or by several user.
... View more