Tuesday
Gick
Pyrite | Level 9
Member since
02-09-2022
- 95 Posts
- 8 Likes Given
- 4 Solutions
- 3 Likes Received
-
Latest posts by Gick
Subject Views Posted 1554 11-30-2023 05:13 AM 1554 11-30-2023 05:12 AM 1612 11-29-2023 11:49 PM 769 11-29-2023 01:08 AM 785 11-29-2023 12:37 AM 2341 11-28-2023 07:57 AM 2380 11-28-2023 05:08 AM 2402 11-28-2023 01:53 AM 2405 11-28-2023 01:52 AM 2459 11-27-2023 11:58 PM -
Activity Feed for Gick
- Posted Re: Concatenation of several tables with the same variable names but some are of different types bet on SAS Programming. 11-30-2023 05:13 AM
- Posted Re: Concatenation of several tables with the same variable names but some are of different types bet on SAS Programming. 11-30-2023 05:12 AM
- Posted Concatenation of several tables with the same variable names but some are of different types between on SAS Programming. 11-29-2023 11:49 PM
- Liked Re: Merge or concatenate the table for Kurt_Bremser. 11-29-2023 01:10 AM
- Posted Re: Transformed table on SAS Programming. 11-29-2023 01:08 AM
- Posted Transformed table on SAS Programming. 11-29-2023 12:37 AM
- Liked Re: Merge or concatenate the table for Patrick. 11-29-2023 12:34 AM
- Posted Re: Merge or concatenate the table on SAS Programming. 11-28-2023 07:57 AM
- Posted Re: Merge or concatenate the table on SAS Programming. 11-28-2023 05:08 AM
- Posted Re: Merge or concatenate the table on SAS Programming. 11-28-2023 01:53 AM
- Posted Re: Merge or concatenate the table on SAS Programming. 11-28-2023 01:52 AM
- Posted Merge or concatenate the table on SAS Programming. 11-27-2023 11:58 PM
- Liked Re: Rename variables with points or propose another calculation approach for PaigeMiller. 10-26-2023 04:40 AM
- Posted Re: Rename variables with points or propose another calculation approach on SAS Programming. 10-25-2023 11:42 AM
- Posted Re: Rename variables with points or propose another calculation approach on SAS Programming. 10-25-2023 11:29 AM
- Posted Rename variables with points or propose another calculation approach on SAS Programming. 10-25-2023 11:03 AM
- Posted Explanation for calling a macro program in another macro program in the same SAS enterprise project on SAS Enterprise Guide. 10-05-2023 08:35 AM
- Posted Re: Retrieve the list of files in the configured folder then import these different xlsx files on SAS Programming. 10-05-2023 08:22 AM
- Posted Re: Retrieve the list of files in the configured folder then import these different xlsx files on SAS Programming. 10-05-2023 07:03 AM
- Posted Re: Retrieve the list of files in the configured folder then import these different xlsx files on SAS Programming. 10-05-2023 06:40 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 2 1 -
My Liked Posts
Subject Likes Posted 2 02-09-2022 10:25 AM 1 02-19-2022 02:40 PM
11-30-2023
05:13 AM
I also did what you just said.
... View more
11-30-2023
05:12 AM
For certain variables, I have missing data even though all my tables are filled.
... View more
11-29-2023
11:49 PM
Hello, I have several sas tables (T1, T2, T3, etc.) I want to concatenate its different tables.
I do the data step correctly with the set instruction. But I get empty lines. On the documentation, it states to see the types of certain variables and to order the variables. I've done it but I still get empty observations. I cannot send an extract of the bases because I cannot find the examples that I know how to create to reflect the problem. Thank you for understanding.
Can anyone give me some hints ?
THANKS. Gick
... View more
11-29-2023
01:08 AM
Here is what I did. ods exclude all; proc freq data=MaTab; table Sexe *(a b c)/ nopercent nofreq nocol out=tab1 ; run; data tab1; set tab1; variable=compress("Sexe","'n'");; Modalite=Sexe; run; From here, I want to create my table for the "Sex" variable. I will do the same method for age. Then I'll concatenate to get my "Want" table. My difficulty is to create the table "tab1_sum" which will look like this : data tab1_sum; input Variable $ Modalite $ a $ b $ c $ ; datalines; Sexe F sum_of_pourcent(fort1,fort2,fort3) sum_of_pourcent(fort1,fort2,fort3) sum_of_pourcent(fort1,fort2,fort3) Sexe H sum_of_pourcent(fort1,fort2,fort3) sum_of_pourcent(fort1,fort2,fort3) sum_of_pourcent(fort1,fort2,fort3) ; run; Then this table "tab1_sum" will be concatenate for each variable in order to have my final table (want). Can someone help me please. THANKS Gick
... View more
11-29-2023
12:37 AM
data MaTab;
input Sexe $ age $ a $ b $ c $ ;
datalines;
F [2-10] fort1 fort2 fort1
H [10-20] fort2 fort1 fort3
F [2-10] fort1 fort1 fort1
F [30-40] fort3 fort1 fort2
H [10-20] fort2 fort1 fort1
H [30-40] fort2 fort3 fort2
H [30-40] fort1 fort3 fort1
F [2-10] fort3 fort3 fort3
;
run;
/*I would like to have a table like:*/
data want;
input Variable $ Mod $ a $ b $ c $ ;
datalines;
Sexe F somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
Sexe H somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
age [2-10] somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
age [10-20] somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
age [30-40] somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
;
run;
Hi,
Note that in the final "Want" table, the sum of the strong is the percentage sum of the crossing sex and a, sex and b, sex and c. I actually get the percentage to create this table. Same approach with age.
Can someone suggest an approach or a program allowing me to have this table (want).
Thanks for your help.
Best regards, Gick.
... View more
11-28-2023
07:57 AM
It's good. Just use "left join" instead of "Inner join". Thank you so much
... View more
11-28-2023
05:08 AM
In fact when there are more than 10 tables, the code does not take into account non-empty ones.
... View more
11-28-2023
01:53 AM
It works for this extracted data. But, when I apply it in my tables, the Mod mode is empty. The mods entered are not displayed and I don't know why? I'll take a screenshot for you. THANKS.
... View more
11-28-2023
01:52 AM
11-27-2023
11:58 PM
data T1;
input mod $ var $ moy1 ;
datalines;
. AA 23
as AA 45
sc AA 68
. CC 0
ic CC 1
vi CC 35
cm CC 235
. DD 4
fi DD 36
dh DD 35
sg DD 10
;
run;
data T2;
input mod $ var $ moy2;
datalines;
. AA 0
as AA 10
sc AA 23
. CC 10
ic CC 12
vi CC 23
cm CC 9
. DD 3.3
fi DD 21
dh DD 16
sg DD 13
;
run;
data T3;
input mod $ var $ moy3 ;
datalines;
. AA 12
as AA 4
sc AA 0
. CC 11
ic CC 35
vi CC 6
cm CC 8
. DD 12
fi DD 4
dh DD 14
sg DD 15
;
run;
/* get the Matab table */
data MaTab;
input mod $ var $ moy1 moy2 moy3 ;
datalines;
. AA 23 0 12
as AA 45 10 4
sc AA 68 23 0
. CC 0 10 11
ic CC 1 12 35
vi CC 35 23 6
cm CC 235 9 8
. DD 4 3.3 12
fi DD 36 21 4
dh DD 35 16 14
sg DD 10 13 15
;
run;
Hi,
I have several sas tables (T1,T2,T3,...,Tn). I am providing you with an extract (T1, T2 and T3). I want to create a code which allows me to have the Matab table whose structure is as follows: (see the table).
I tried to get it by concatenating or merging (merge with data step or sql with proc sql) without success. The result in screenshot is not good and this is what I get even though I want to have the Matab table.
Can anyone suggest me a code or an approach that can get the Matab table please.
Best regards,
Gick
... View more
10-25-2023
11:42 AM
However the code returns the results to me several times. In fact, as many variables, as many results are repeated.
... View more
10-25-2023
11:29 AM
Of course. even I rename first but there are several (more than 100 variables) like that
... View more
10-25-2023
11:03 AM
data MaTable;
input Nom $ "A.D.C_EF"n $ Score_biomarqueur Score_pesticides "Q13t"n $ "Q13bist"n $ "Q1.A"n $ "Qt.2"n $;
datalines;
Doe John 30 1 oui o T i
Smith Jane 25 20 oui n T o
Brown Alice 35 2 non n T o
A C 2 2 non n K j
A C 5 23 non n K j
B John 10 21 non n K l
K C 31 13 oui o K l
B Jane 21 4 non o S l
;
run;
%macro stat_central();
proc sql ;
select name into :char_vars separated by ' '
from dictionary.columns where libname='WORK' and memname="MATABLE" and type='char';
quit;
%put &char_vars.;
%do k=1 %to %sysfunc(countw(&char_vars.));
%let char = %scan(&char_vars., &k.);
proc sort data=MATABLE;
by "&char."n;
run;
proc means data=MATABLE;
var Score_biomarqueur Score_pesticides;
class "&char."n;
run;
%end;
%mend;
%stat_central();
Hi,
Here is an extract from my table. I want to run this macro program but I get an error message because of the variables having dots. In fact, these variables separate into 2 or more variables. As a result, SAS no longer finds them in the base.
Can anyone help me solve this problem or suggest another approach?
Note that this is just an extract from the table. I have several variable names written with periods.
Best regards, Gick
... View more
10-05-2023
08:35 AM
Hi,
I have a SAS project (.egp) containing several SAS programs (.sas) named: cal, Lau, pest.
In Cal, I created a macro program and I want to call it to use in my Lau macro program. How to do ?
Can someone explain to me please?
Thank you
Gick
... View more
10-05-2023
08:22 AM
%macro import_files(BIO=); /*1**/ data fichiers (keep=fichiers); length fichiers $256; fich=filename('fich',"&BIO."); /* */ did=dopen('fich'); /* compt */ nb_fich=dnum(did); do i=1 TO nb_fich; fichiers=dread(did,i); output; end; /* */ rc=dclose(did); run; /*2 */ proc sql; select SUBSTR(fichiers, 1, INDEX(fichiers, '.') - 1) into :Labo_list separated by ' ' from fichiers; quit; %put &Labo_list.; /* log */ /*3 -*/ %do l = 1 %to %sysfunc(countw(&Labo_list.)); %let labo = %scan(&Labo_list., &l.); %put &labo.; proc import datafile="&BIO.\&labo." out=Labo&l. dbms=XLSX replace; run; %end; data BDD_labo; set %do i = 1 %to %sysfunc(countw(&Labo_list.)); Labo&i. %end; ; run; %mend; %import_files(BIO=C:\BIO);
... View more