Automate SAS Studio Flows Documentation with Azure OpenAI in a Custom Step
Recent Library Articles
Recently in the SAS Community Library: SAS' @Bogdan_Teleuca reveals how leveraging Azure OpenAI and a SAS Studio custom step, you can generate clear, detailed and governance-focused flows documentation in seconds.
Howdy!
I am trying to use the PRESORTED option of PROC SORT to avoid multiple, very lengthy (~10 minutes) sorts. However, I am finding that SAS sometimes does not accept that a sorted dataset is truly sorted when also using NoDupRec.
My dataset, labs, I have already sorted by all variables. When I sort it with no options, SAS tells me it's already sorted. When I add PRESORTED, it tells me it's already sorted. But when I add PRESORTED and NoDupRec, it tells me the data is not sorted. However, the meta data does show the data sorted (of course). Does anyone know what's going on?
1125 proc sort data = labs;
1126 by _all_;
1127 run;
NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1456.12k
OS Memory 26644.00k
Timestamp 03/26/2025 10:21:41 PM
Step Count 50 Switch Count 0
1128 proc sort data = labs presorted;
1129 by _all_;
1130 run;
NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.01 seconds
memory 1456.12k
OS Memory 26644.00k
Timestamp 03/26/2025 10:21:41 PM
Step Count 51 Switch Count 0
1131 proc sort data = labs presorted noDupRec;
1132 by _all_;
1133 run;
NOTE: Input data set is not in sorted order.
When I tried a super simple example, it works fine.
1143 proc sort data = sasHelp.class out = class;
1144 by _all_;
1145 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: SAS sort was used.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: Compressing data set WORK.CLASS increased size by 100.00 percent.
Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.01 seconds
user cpu time 0.00 seconds
system cpu time 0.01 seconds
memory 1213.43k
OS Memory 26636.00k
Timestamp 03/26/2025 10:23:46 PM
Step Count 56 Switch Count 0
1146 proc sort data = class presorted;
1147 by _all_;
1148 run;
NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 328.28k
OS Memory 25860.00k
Timestamp 03/26/2025 10:23:46 PM
Step Count 57 Switch Count 0
1149 proc sort data = class presorted noDupRec;
1150 by _all_;
1151 run;
NOTE: Sort order of input data set has been verified.
NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 328.28k
OS Memory 25860.00k
Timestamp 03/26/2025 10:23:46 PM
Step Count 58 Switch Count 0
Thanks,
Michael
... View more
TLDR: I want to conduct a balancing test / F-statistic to see if 6 control variables (foed_kom_num, foed_mmyy, spacing_mon, mor_alder, far_alder, and andel_mor_foed) can predict the variable of interest ('brother'). THANK YOU! Dear everyone, this is my first post in this community—I hope someone has the time to help. I use SAS 9.4 (English with DBCS). I'm working on my thesis and replicating parts of the article "Brothers Increase Women’s Gender Conformity" by Anne Brenøe (2021). I'm using slightly different data and variables. In Table 1, Panel B, she conducts a balancing test/joint F-statistic to test whether all seven control variables in her OLS model can predict the variable of interest. Her model (simplified) is: y = alpha_0 + alpha_1 * brother + X * delta + error term, where 'brother' is the variable of interest, and X is a vector of the seven control variables. The outcome for the balancing test is reported as: joint F-statistic: 0.92 prob > F: 0.92 Please note that she provides only one result (0.92). My model follows the same structure: y = alpha_0 + alpha_1 * brother + X * delta + error term, where 'brother' is again the variable of interest. However, my vector X contains only six control variables: foed_kom_num, foed_mmyy, spacing_mon, mor_alder, far_alder, and andel_mor_foed (written in Danish so I can follow your answers—I hope this makes sense even though it’s not in English.) Variables formats: brother: 1 if boy, 2 if girl foed_kom_num: numeric best12. foed_mmyy: numeric best12. spacing_mon: numeric best12. mor_alder: numeric best12. far_alder: numeric best12. andel_mor_foed: numeric best12. I've spent a long time searching and using ChatGPT, but I can't seem to get just one joint result. The closest I've come is with the following code. (Note: I would like to use an OLS-based approach, as my supervisor is not fond of logistic approaches. I also believe Brenøe uses an OLS-based test.). Hope someone can help. Thanks a lot in advance. Best, Jo /* Step 1: Run the Full Model */
proc glm data=your_data outstat=full_stats noprint;
model brother= foed_kom foed_mmyy spacing_mon mor_alder far_alder andel_mor_foed;
run;
/* Step 2: Run the Reduced Model (Intercept Only) */
proc glm data=your_data outstat=reduced_stats noprint;
model brother = ;
run;
/* Step 3: Extract SSE and Compute F-Statistic */
data f_test;
merge full_stats (where=(_TYPE_='ERROR') rename=(SS=SSE_full DF=DF_full))
reduced_stats (where=(_TYPE_='ERROR') rename=(SS=SSE_reduced DF=DF_reduced));
p = 6; /* Number of predictors */
n = DF_reduced + 1; /* Total observations */
df_num = p;
df_den = DF_full;
/* Compute F-statistic */
F_stat = ((SSE_reduced - SSE_full) / df_num) / (SSE_full / df_den);
/* Compute p-value */
p_value = 1 - probf(F_stat, df_num, df_den);
run;
/* Step 4: Print the F-statistic and p-value */
proc print data=f_test;
var F_stat p_value;
run;
... View more
Hi everyone, I've been using the SAS documentation website for at least 10 years. However, for at least the last 5 years it has been so incredibly slow to load. It normally takes up to a minute to load but often takes 5 minutes to load. Why is this? It is the only website that I ever have trouble with. For example, one of the SAS bookmarks I have is: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1g0aqhqgty60yn1o3snwb7z2ppa.htm It is so frustrating. Using the SAS website is like travelling back in time to early 1990s internet. It can't be my PC or network. I have no trouble with any other site on the internet but always have trouble with SAS. Has anyone else encountered this? It's entirely unsatisfactory.
... View more
Hi mates, Maybe exist any way to write parquet or avro files from SAS 9.4M8 using the classic bulk load? the final location for this type of files should be s3 storage of CDP public cloud. thanks for any help!
... View more
Your journey through times that are a-changin’
It was the best of times, it was the worst of times.
With apologies to Charles Dickens, it’s not A Tale of Two Cities. It’s our modern-day tale of marketing and marketing technology in managing the customer journey at the dawn of the Era of AI.
It’s the best of times because we are lucky enough to be working during a period of incredible disruption in marketing and business more broadly.
Why is disruption our good fortune? It’s an opportunity to break the status quo and forge the future. Great careers are not made from yesterday’s playbooks. They’re made by pioneering new ideas. A generational moment of disruption — such as we’re experiencing now — gives us the chance to innovate better ways of attracting, engaging, and delighting customers.
You can help pen the playbook that others will follow.
It’s the worst of times because, yikes, things are changing fast! Just keeping track of the weekly updates of what’s possible with AI — and the ways in which it can affect customer expectations — is an exhausting, full-body workout. But deciding which changes to embrace, when and how, and then actually driving their successful adoption throughout your organization is, frankly, the quintessential management challenge of the 21st century.
This struggle between the exponential rate of technological change and the much slower rate of organizational change is known as “Martec’s Law.” Picture yourself with one foot on a dock and one foot on a ferry as it’s pulling away. That’s what Martec’s Law feels like.
Unfortunately, there is no silver bullet to overcome Martec’s Law. Operating in an environment where the pace of change will forever exceed our capacity to completely catch up is the new normal now. Sorry.
But don’t despair! This is actually an opportunity, as all great challenges are.
Because you’re not the only one wrestling with Martec’s Law. Everyone else is too, including all your competitors. To win, you don’t need to escape Martec’s Law. You only need to be better at managing it than they are.
And you can manage it.
You have two big levers to pull:
Be strategic about which changes you embrace.
Be more agile in how you embrace them.
With the first, you simply can’t chase all the changes in the market at once. Fortune favors the focused. It’s important to continually explore new possibilities on the frontier. But you get your leverage by exploiting those that show the greatest promise. What’s going to be most impactful for your customers? What’s going to best harmonize with your other strategic bets? Make a few clear choices — which necessitates clear omissions — and put your weight behind them.
This will give you an edge over competitors who waffle too long or peanut butter their time and resources too thinly across too many choices.
The second lever is all about how you operationalize those strategic choices. Being more agile isn’t a euphemism for “work faster” or code for doubling the amount of task switching everyone does. Such naive approaches have the opposite effect and end up dragging you down. Real agility is developed by building more adaptable approaches to technology, tactics, and talent.
Insist on open and composable technical architectures that make it easier for you to quickly add, change, or remove components, capabilities, and use cases. Implement legit agile management practices in your processes, workflows, and customer journeys: short feedback loops, iterative refinement, and dynamic prioritization. Invest in greater training, enablement, and empowerment for teams and individuals to fully tap the power of the new tools and technologies you give them.
These two levers aren’t magic. They’re muscles that can be developed. And they will help you win.
This report from SAS contains a wealth of insights to help you chart your journey through these changing times, to enable you, and inspire you to shape a new generation of customer journeys. As you move forward and modernize your martech capabilities — technology, tactics, and talent — for this era of AI-powered marketing and customer experiences, I encourage you to seize the opportunity to also develop your meta-level muscles for mastering change.
That will be a truly durable competitive advantage in an age of continuous transformation.
Best wishes on your journey,
Scott Brinker Editor, chiefmartec
... View more
Nominations are in, and the SAS Customer Recognition Awards voting is complete! Winners get a full trip to SAS Innovate (May 6-9) in Orlando, FL! See the 60+ inspiring entries from SAS users! Winners will be announced at SAS Innovate!