A Human Generated Introduction to Generative AI, Part 1: Synthetic Data Generation
Recent Library Articles
Recently in the SAS Community Library: In the first of two posts on applications of generative AI, SAS' @JThompson reveals the role of generating synthetic data.
I have a SAS file which is opened under SERVER=SHARE, because it can be used by multiple users. However, for the majority of users, we want to disable the DELETE command, so they can view / Add / Dup / MOD, but they will NOT be able to delete ay record. And for some power users, we want to keep the DELETE command on and operational. Can this be done using SCL code ? I have tried to use a special "PROC FSEDIT DATA=dataset_name NOBORDER NODELETE;" for them, and a standard PROC FSEDIT DATA=dataset_name NOBORDER; for the other users, but as soon as the first one (with teh NODELETE) is used once, the whole dataset becomes in a "NODELETE" for everyone 😞 Thanks for giving me any way to have SAS makes my expectations come true. Sylvain
... View more
Hi, We are looking to improve data inserts in a SQL Server database (ODBC). In the SAS server connection, we have the advanced option to set 'Bulk Load' to Yes: but we can also set this advanced option in the ODBC setup. Do we have to set it in both? Thx.
... View more
Dear SAS Community,
I get this 'ERROR: All variables in array list must be the same type' when using this code after transposing data from wide to long format. All this variables (FruitWt, Color, Rind, Button, Wtloss) are numeric variables, but since my data set starts with missing values (.) maybe that is why? I would greatly appreciate your help!
data long;
set new;
array _FruitWt (*) Day0_FruitWt Day3_FruitWt Day7_FruitWt ;
array _Color(*) Day0_Color Day3_Color Day7_Color ;
array _Rind (*) Day0_Rind Day3_Rind Day7_Rind;
array _Button (*) Day0_Button Day3_Button Day7_Button;
array _Wtloss (*) Day0_Wtloss Day3_Wtloss Day7_Wtloss;
do i=1 to dim(_FruitWt);
label=scan(vname(_FruitWt(i)), 1, "_");
FruitWt=_FruitWt(i);
Color=_Color(i);
Rind=_Rind(i);
Button=_Button(i);
Wtloss=_Wtloss(i);
output;
end;
drop Day0_: Day3_: Day7_: i;
run;
Here is the data new:
Obs
Test
Grower
Treatment
FruitNr
Day0_FruitWt
Day0_Color
Day0_Rind
Day0_Button
TRT_day3
Day3_FruitWt
Day3_Color
Day3_Rind
Day3_Button
Day7_FruitWt
Day7_Color
Day7_Rind
Day7_Button
Day3_Wtloss
Day7_Wtloss
1
1
1
Initial
1
146.15
6
0
0
NA
.
.
.
.
.
.
.
.
.
.
2
1
1
Initial
2
218.42
5
0
3
NA
.
.
.
.
.
.
.
.
.
.
3
1
1
Initial
3
164.77
5
0
3
NA
.
.
.
.
.
.
.
.
.
.
4
1
1
Initial
4
174.28
6
0
3
NA
.
.
.
.
.
.
.
.
.
.
5
1
1
Initial
5
157.36
6
0
3
NA
.
.
.
.
.
.
.
.
.
.
... View more
I asked a similar question in a different thread for a single variable proc freq table here, but was curious if it could also be done with a multi-variable analysis. Essentially, the title of the thread: is it possible to order a column in a multi-variable proc freq table by a separate variable not being analyzed? For example, take the following data: County_Name Yes_No County_Code A Yes 1 A Yes 1 A Yes 1 A No 1 B No 2 B No 2 B No 2 C Yes 5 C Yes 5 C Yes 5 C Yes 5 C No 5 D No 4 D No 4 D Yes 4 E Yes 3 E Yes 3 E No 3 E No 3 F Yes 6 F Yes 6 F No 6 F No 6 Normally, if I made a proc freq table to count the frequency of yes/no's for each county, as so: proc freq data=data; tables County_Name*Yes_No; run; I would get an output table similar to the following: County_Name Freq Yes No Total A 3 1 4 B 0 3 3 C 4 1 5 D 1 2 3 E 2 2 4 F 2 2 4 However, is it possible to produce a similar table, but have the County_Name variable ordered according to its corresponding County_Code value? So, a table that would look like this instead: County_Name Freq Yes No Total A 3 1 4 B 0 3 3 E 2 2 4 D 1 2 3 C 4 1 5 F 2 2 4 I tried to do something similar to the single-variable solution, but instead got a larger cross-tabulation that gave a separate row for each combination, instead of having the yes/no frequency in their own columns. Something like this: proc freq data=data; tables County_Code*County_Name*Yes_No / list; run; County_Code County_Name Yes_No Freq 1 A Yes 3 1 A No 1 2 B Yes 0 2 B No 3 3 C Yes 4 3 C No 1 4 D Yes 1 4 D No 2 5 E Yes 2 5 E No 2 6 F Yes 2 6 F No 2
... View more
Is there a way to have a variable in a proc freq table be sorted according to it's value in a different variable? For example, consider the following data: County_Name Value County_Code A 1 1 B 2 2 A 3 1 A 4 1 B 4 2 C 6 5 D 7 6 E 9 3 F 7 4 G 3 7 And I want to create a proc freq table to find the frequency with which each county appeared in the list. However, in the subsequent proc freq table, I want them to be ordered according to their corresponded County_Code, instead of alphabetically. Is this possible in SAS?
... View more