a week ago
davidlogan
Obsidian | Level 7
Member since
06-25-2021
- 10 Posts
- 4 Likes Given
- 0 Solutions
- 3 Likes Received
-
Latest posts by davidlogan
Subject Views Posted 302 a month ago 390 a month ago 369 02-21-2025 06:13 AM 602 02-05-2025 04:12 AM 4096 01-08-2024 08:09 AM 1194 05-11-2023 05:37 AM 3477 02-18-2022 08:12 AM 1481 02-17-2022 06:58 AM 1483 02-17-2022 06:50 AM 1605 02-16-2022 05:34 AM -
Activity Feed for davidlogan
- Posted Re: %fmtsearch_contents Macro - Lists of ALL SAS formats in FMTSEARCH path on SAS Communities Library. a month ago
- Posted %fmtsearch_contents Macro - Lists of ALL SAS formats in FMTSEARCH path on SAS Communities Library. a month ago
- Posted Re: SAS Viya High Throughput Batch Processing: Part 1 – Reusable Batch Servers on SAS Communities Library. 02-21-2025 06:13 AM
- Liked SAS Viya High Throughput Batch Processing: Part 1 – Reusable Batch Servers for EdoardoRiva. 02-21-2025 06:13 AM
- Tagged %fmtsearch_contents Macro - Lists of ALL SAS formats in FMTSEARCH path on SAS Communities Library. 02-06-2025 03:15 AM
- Tagged %setdates macro - generates SAS date macro variables in multi-formats on SAS Communities Library. 02-05-2025 05:57 AM
- Tagged %setdates macro - generates SAS date macro variables in multi-formats on SAS Communities Library. 02-05-2025 05:57 AM
- Tagged %setdates macro - generates SAS date macro variables in multi-formats on SAS Communities Library. 02-05-2025 05:57 AM
- Tagged %setdates macro - generates SAS date macro variables in multi-formats on SAS Communities Library. 02-05-2025 05:57 AM
- Posted Re: Macro help for dates on SAS Programming. 02-05-2025 04:12 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
- Tagged ABSA Bank - 2025 Customer Recognition Awards: Innovative Problem Solver on 2025 SAS Customer Recognition Awards. 02-04-2025 08:38 AM
-
Posts I Liked
Subject Likes Author Latest Post 5 7 1 3 -
My Liked Posts
Subject Likes Posted 2 02-17-2022 06:58 AM 1 02-16-2022 05:34 AM -
My Library Contributions
Subject Likes Author Latest Post 2 8
a month ago
Definitely a much simpler and more elegant solution from Tom to achieve the same result. I tip my hat 🙂
... View more
a month ago
2 Likes
In many SAS environment the SAS Options FMTSEARCH path can concatenate a list of SAS catalogs where shared formats can be acccessed and used. But what if there are duplicate formats across multiple catalogs. This macro uses the value of FMTSEARCH to extract all formats stored across the catalogs listed and creates a dataset containing the list, including highlighting any potential issues.
See %fmtsearch_contents(attached), sample output below highlighting potential duplicate formats
NOTE : Also uses %setoptions (attached) AND %setdates macro (see link below - used to identify formats not recently updated)
https://communities.sas.com/t5/SAS-Communities-Library/setdates-macro-generates-SAS-date-macro-variables-in-multi/ta-p/797171
... View more
- Find more articles tagged with:
- fmtsearch
- Format troubleshooting
- SAS formats
Labels:
02-21-2025
06:13 AM
This is a great article. As a customer we have been simulating re-usable batch servers for a few months to solve the exact problem of not just the startup lag, but also the high number of containers used relative to the SAS program time (sometimes short). on Aws, we essentially start up a "master" SAS program (via the CLI) which loops repeatedly for 4 hours, checking dependencies and pre-requisites every few minutes. When required it generates a batch Linux CLI .sh script (new container for long running jobs) or SAS executable .sh script (short job to run within existing container), so the "master " program runs exactly like the long running container described.
... View more
02-05-2025
04:12 AM
https://communities.sas.com/t5/SAS-Communities-Library/setdates-macro-generates-SAS-date-macro-variables-in-multi/ta-p/797171
the above %setdates macro may help set all the SAS Macro value for dates you might ever need. the user selects a reference date e.g. %setdates(date=01feb25) and a v large number of macro values containing dates in various formats are created from that.
... View more
01-08-2024
08:09 AM
We have also been busy with a batch SAS Grid Code -> SAS Viya (AWS) Migration exercise. We have run (almost) identical base SAS only code (Over 100,000 lines across hundreds of program and complex dependancies) with "minimal" changes, although this may be because historically we haven't gone the full product (DI Studio/LSF/etc) stack which ties the scheduling to very specific software.
Agreed, any time only based scheduling is a non-starter for most real world applications.
We essentially use a continuously running Base SAS "master" job
1) Checks dependancies
2) Generates Linux <program name>.sh script
3) which asynchronously executes 1..n <program name>.sas
4) Creating SAS log files e.g. <timestamp_<program name>.log.ok/error
The key is the log file produced per job contains the complete run date/name/status context
Because at it's core it's base SAS, it essentially operates exactly the same. We can run the same code on Grid, submit from Grid to Viya, or submit on Viya directly. It also enables auto-restart from a set of defined, recoverable errors in any log.
The devil is in the detail and it's a major departure from your approach but it's been working so far for us, also making it easier to keep the same code in synch on Grid and Viya, during the migration process.
... View more
05-11-2023
05:37 AM
Thanks Atabarut and Alex for the comments, the team worked well together, it's notable that 1 of the team members started working with SAS in Jan 23 (only 3 months experience) but did great work using the Data Explorer and got up to speed very quickly. He also did the data anonymisation and auto-variable reduction as general solutions which speaks to the flexiblity of SAS.
... View more
02-18-2022
08:12 AM
8 Likes
See attached setdates.sas macro, which generates a large number of SAS global macro variables containing (day,wk,month,qtr,year) dates of differing formats (e.g. monyy7). Values are generated relative to current date i.e. day0=today, day1=yesterday, mon0=this month, mon1=last month, etc.
Example:
%put &mon1_start_date9;
resolves to 01JAN2022 (1st of previous month if current month is Feb2022) and:
%put &mon1_start_date9q;
resolves to '01JAN2022' (the above value in single quotes - useful for pass-thru SQL queries.
Can be overridden using:
%setdates(date=ddmonyy);
This is useful for program testing back and forward in time.
Particularly useful when added to the SAS root macro folder and invoked on any SAS session execution. Allows for standardisation across installations with hundreds of users.
sysdt macro values always refer to system date (not reference date).
---------------------
Having standardised, predictable, meaningful macro variables names is useful in a number of ways:
1) Looping around dates (see %tmp macro below).
2) Also using for e.g. &mon1_yyyy (which is the yyyy year of the previous month) means not having to write logic to cater for year changes when performing a Dec21 run in Jan22.
3) Avoids users creating (and referencing macro variables with personal preference naming convention like 'mydate' which has little meaning.
4) Avoids sometimes convoluted date mathematics to get basic date parameters. When reading someone else's code this has to be first deconstructed to understand meaning.
%macro tmp;
%do i=1 %to 10;
%put &&mon&i._yyyymm;
%end;
%mend;
%tmp;
202201
202112
202111
202110
202109
202108
202107
202106
202105
202104
... View more
- Find more articles tagged with:
- Date Formats
- SAS Dates
- SAS macro
- Standardization
Labels:
02-17-2022
06:58 AM
2 Likes
Hi Reeza, This look like a more suitable location, thanks! looks like SAS doesn't consider me experienced enough yet though 🙂 \
... View more
02-17-2022
06:50 AM
Hi Quentin, Thanks for this, googling does indeed produce plenty of SAS macro definitions, with the onus on you to separate the wheat from the chaff, hence my question (within the topic) about if there is a recognised repository. I was posting the macro as a something which other users might find useful, so it wasn't actually a question (despite being in the questions section), although it appears to be the only place I could post something like this
... View more
02-16-2022
05:34 AM
1 Like
Over the years I've seen a variety of useful SAS macros, some more general solution than others, but I don't think there's a central searchable location where they can be posted to. Q - Is there a recognised/searchable location for general purpose SAS Macros like this one? ----------------------------------- See attached setdates.sas macro which generates a large number of SAS global macro variables containing (day,wk,month,qtr,year) dates of differing formats (e.g. monyy7), values are generated relative to current date i.e. day0=today, day1=yesterday, mon0=this month, mon1=last month, etc Example %put &mon1_start_date9; resolves to 01JAN2022 (1st of previous month if current month is Feb2022) %put &mon1_start_date9q; resolves to '01JAN2022' (the above value in single quotes - useful for pass-thru SQL queries can be overridden using %setdates(date=ddmonyy); this is useful for program testing back and forward in time. Particularly useful when added to the SAS root macro folder and invoked on any SAS session execution. Allows for standardisation across installations with hundreds of users. sysdt macro values always refer to system date (not reference date) --------------------- Having standardised, predictable, meaningful macro variables names is useful in a number of way 1) looping around dates (see %tmp macro below). 2) Also using for e.g. &mon1_yyyy (which is the yyyy year of the previous month) means not having to write logic to cater for year changes when performing a Dec21 run in Jan22. 3) Avoids users creating (and referencing macro variables with personal preference naming convention like 'mydate' which has little meaning 4) Avoids sometimes convoluted date mathematics to get basic date parameters. When reading someone else code this has to be first deconstructed to understand meaning. %macro tmp; %do i=1 %to 10; %put &&mon&i._yyyymm; %end; %mend; %tmp; 202201 202112 202111 202110 202109 202108 202107 202106 202105 202104
... View more
- Tags:
- SAS Dates
- SAS macros