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.
My previous post relating to my issue with this activity related to the library error which I was able to fix! Now I'm having a different issue. This is the warning: proc export data=pg1.storm_final 74 outfile="&outpath/storm_final.csv" WARNING: Apparent symbolic reference OUTPATH not resolved. 75 dbms=csv replace; 76 run; I also have an error: ERROR: Physical file does not exist, C:\Users\learnsas-16391\&outpath\storm_final.csv. NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 1 observations read from the data set PG1.STORM_FINAL. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
... View more
This month's SAS Viya Release Highlights Show takes us to Grapevine, Texas for SAS Innovate 2026. It’s not our first rodeo, so expect the latest updates in all things Data and AI at SAS, including Agentic AI, SAS Viya Copilot, SAS AI Navigator, Quantum, and more from SAS’ premier data and AI event.
Plus, hear from Jared Peterson, Senior Vice President of Global Engineering at SAS, as he introduces the term Data Intelligence, which turns data into trusted, explainable decisions at scale. And, learn how SAS combines innovation and open standards with built-in governance by leveraging Model Context Protocol (MCP) and Retrieval-Augmented Generation (RAG).
... View more
Hello Expert!
I'm wondering how to perform a 10-fold cross-validation to retrieve the parameter for Ridge regression.
Indeed, when I apply this code :
proc glmselect data=train plots=all;
model Y= X1 X2 X3 /
selection=elasticnet(choose=cv l1=0 l2search=grid stop=l1)
cvmethod=split(10);
run;
The Ridge shrinkage criterion is not displayed in the output.
Thank you for your help.
... View more
Watch this Ask the Expert session to explore how to build and extract date information, plus advanced techniques for generating dynamic, flexible date values.
Watch the Webinar
You will learn:
SAS date functions.
SAS date formats.
How to use the macro facility to create dates.
The questions from the Q&A segment held at the end of the webinar are listed below and the slides from the webinar are attached.
What does ISO Time mean?
ISO times in SAS follow the ISO 8601 international standard, which provides a consistent, unambiguous numeric representation of time values so data can be shared globally without confusion.
SAS implements this standard through ISO 8601 formats and informats to read, store, and display time and datetime values.
Here’s a link for more information: Reading Dates and Times by Using the ISO 8601 Basic and Extended Notations
When should you use SAS date formats versus SAS date functions to present or work with date information in your code?
SAS formats are strictly for displaying. So, if it's a matter of displaying your date value in different patterns, then you want to use your formats.
But if you are doing calculations, you need to do calculations based on the source date numbers. You can't use the formatted values for calculations. The formatted value is just for display purposes. The actual functions do calculations on the source date numbers.
What if I want to get DATE9. output or MMDDYY10.?
Apply them on a FORMAT statement.
If I can interpret the question a little more, I think what you might be asking is what if you want both. If you want both in the same report, then you can use an assignment statement in a DATA step to create two versions of your date column.
Your first one is DATE, then maybe create DATE1 equal to DATE, and then you can apply separate formats to each of those columns.
DATA NEWTABLE;
SET INPUTTABLE; /* the source table has a column DATE */
DATE1 = DATE;
FORMAT DATE DATE9. DATE1 MMDDYY10.;
RUN;
Any idea why CONTINUOUS is not the default INTCK method?
SAS explicitly defines INTCK as counting how many interval boundaries are crossed (for example, month boundaries or year boundaries).
This naturally leads to discrete counting because:
A boundary is either crossed or not crossed.
There is no fractional crossing.
Here’s a link with more information: INTCK Function
How can the SAS macro facility be used to create dynamic, flexible dates that adapt to changing reporting or processing needs?
The way to use dates with the macro facility is to use %SYSFUNC. That's what's going to give you that dynamic feature with your dates.
Using %SYSFUNC with your date values and your date functions gives you that flexibility. It’s the combination of those.
For more information, consider the course: SAS® Macro Language 1: Essentials
Are there ways to normalize international times like GMT, etc.?
SAS does support normalizing international times (GMT/UTC, local zones, etc.), but it does so through a combination of time zone options, ISO 8601 formats, and specific timezone functions, rather than a single “normalize” function.
SAS strongly supports ISO 8601 for international normalization.
For more information: Working with Dates and Times by Using the ISO 8601 Basic and Extended Notations
I have seen my colleagues use dates in this pattern "01JAN2026"D. What is this and how does it work?
What you've described is something called a date constant. It's essentially a shortcut for displaying your SAS date or converting a SAS date to a number.
By writing a date in the pattern "01JAN2026"D, you don't have to calculate the number of days manually. SAS automatically converts it for you.
It saves you from having to calculate the number of days yourself.
For example, to calculate how many days an order_date has been outstanding since January 1, 2026:
DAYSPASSED = "01JAN2026"D - ORDER_DATE;
Is there a function that takes times from different time zones and standardizes them all to UTC (or GMT)?
SAS does provide built-in functions specifically for standardizing datetime values to UTC (GMT), including TZONES2U.
For more information: TZONES2U Function
For DATETIME variables, if I format to MONYEAR, does SAS still store the specific date and time?
Yes. SAS always stores the original numeric value.
Formats are only for display. Even if you format the value as month and year, the full date and time are still stored behind the scenes.
Can dates be stored as character values in SAS?
Yes, dates can be stored as character values. However, you will be limited.
You won't be able to do date calculations. You can apply character functions to extract parts of the value, but you lose access to numeric date functions and interval calculations.
Is there an input format for columns with multiple character date formats?
Yes. The ANYDTDTEw. informat can read a wide variety of date and datetime patterns.
For more information: ANYDTDTEw. Informat
If you still cannot find the informat you need, you can create your own using PROC FORMAT with an INVALUE statement.
Recommended Resources
Course: SAS® Programming 1: Essentials
Course: SAS® Macro Language 1: Essentials
SAS Macro Language 2: Advanced Techniques
Please see additional resources in the attached slide deck.
Want more tips? Be sure to subscribe to the Ask the Expert board to receive follow up Q&A, slides and recordings from other SAS Ask the Expert webinars.
... View more
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc export data=pg1.storm_final
74 outfile="&outpath/storm_final.csv"
WARNING: Apparent symbolic reference OUTPATH not resolved.
75 dbms=csv replace;
76 run;
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
77 /**********************************************************************
78 * PRODUCT: SAS
79 * VERSION: 9.4
80 * CREATOR: External File Interface
81 * DATE: 09MAY26
82 * DESC: Generated SAS Datastep Code
83 * TEMPLATE SOURCE: (None Specified.)
84 ***********************************************************************/
85 data _null_;
86 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
87 %let _EFIREC_ = 0; /* clear export record count macro variable */
88 file '&outpath/storm_final.csv' delimiter=',' DSD DROPOVER lrecl=32767;
89 if _n_ = 1 then /* write column names or labels */
90 do;
91 put
92 "Season"
93 ','
94 "Name"
95 ','
96 "Basin"
97 ','
98 "BasinName"
99 ','
100 "OceanCode"
101 ','
102 "Ocean"
103 ','
104 "StormType"
105 ','
106 "MaxWindMPH"
107 ','
108 "MaxWindKM"
109 ','
110 "MinPressure"
111 ','
112 "StartDate"
113 ','
114 "EndDate"
115 ','
116 "StormLength"
117 ','
118 "Lat"
119 ','
120 "Lon"
121 ;
122 end;
123 set PG1.STORM_FINAL end=EFIEOD;
124 format Season best4. ;
125 format Name $char57. ;
126 format Basin $char2. ;
127 format BasinName $14. ;
128 format OceanCode $2. ;
129 format Ocean $8. ;
130 format StormType $13. ;
131 format MaxWindMPH best12. ;
132 format MaxWindKM 3. ;
133 format MinPressure best12. ;
134 format StartDate date9. ;
135 format EndDate date9. ;
136 format StormLength best12. ;
137 format Lat best12. ;
138 format Lon best12. ;
139 do;
140 EFIOUT + 1;
141 put Season @;
142 put Name $ @;
143 put Basin $ @;
144 put BasinName $ @;
145 put OceanCode $ @;
146 put Ocean $ @;
147 put StormType $ @;
148 put MaxWindMPH @;
149 put MaxWindKM @;
150 put MinPressure @;
151 put StartDate @;
152 put EndDate @;
153 put StormLength @;
154 put Lat @;
155 put Lon ;
156 ;
157 end;
158 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */
159 if EFIEOD then call symputx('_EFIREC_',EFIOUT);
160 run;
ERROR: Physical file does not exist, C:\Users\learnsas-16391\&outpath\storm_final.csv.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 1 observations read from the data set PG1.STORM_FINAL.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
0 records created in &outpath/storm_final.csv from PG1.STORM_FINAL.
NOTE: "&outpath/storm_final.csv" file was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.16 seconds
cpu time 0.12 seconds
161
162 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
174
... View more