<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LLM to review SAS coding?  Which is best? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931371#M366420</link>
    <description>&lt;P&gt;The primary problem, so it seems, has to do with &lt;STRONG&gt;macros&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;The art of using macros is a bit tricky?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 08 Jun 2024 05:32:16 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2024-06-08T05:32:16Z</dc:date>
    <item>
      <title>LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931058#M366294</link>
      <description>&lt;P&gt;Rather than asking on this forum to "please check my SAS code and tell me what's wrong?", I decided to ask Anthropic's Claude for help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, way too often what Claude suggested simply did not work.&amp;nbsp; I asked again, and again.&amp;nbsp; Claude kept trying to change the SAS code to get it to successfully execute.&amp;nbsp; But, alas, it turned out to be mostly a waste of time.&lt;BR /&gt;&lt;BR /&gt;So, just curious what your take is.&amp;nbsp; Do &lt;STRONG&gt;ANY&lt;/STRONG&gt; of the LLMs know SAS fairly well, enough for us to post some code and ask it to show where problems are occurring?&lt;BR /&gt;&lt;BR /&gt;Your thoughts greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 21:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931058#M366294</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2024-06-05T21:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931062#M366297</link>
      <description>&lt;P&gt;From what has been generated, or at least that the questioner admitted using ChatGPT or similar, to generate code my off the cuff answer is "probably not yet".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think part of the issue can be that SAS Institute had two families of products, SAS and JMP,&amp;nbsp; that might confuse some of the models. Also SAS has a few other meanings in other contexts and may have more issues. Plus Enterprise Guide and the changes around Viya/ CAS can't be helping.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just for fun you might want to peruse Proc Template syntax. Ancient stuff related to Greplay, ODS styles, Graphic Template Language, the table/graph output definitions used by procedures and that just the stuff I'm aware of.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 22:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931062#M366297</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-06-05T22:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931072#M366306</link>
      <description>&lt;P&gt;"T&lt;SPAN&gt;o generate code..."&lt;BR /&gt;&lt;BR /&gt;Actually, the question was, to &lt;STRONG&gt;review&lt;/STRONG&gt; code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And, the more specific question is whether &lt;STRONG&gt;ANY&lt;/STRONG&gt; of the current LLMs have a better ability to do this, review SAS code.&lt;BR /&gt;&lt;BR /&gt;One can probably show any of them some SAS code, say, with a mistake or two.&amp;nbsp; So, how do they handle it?&amp;nbsp; Do any of them respond, for example, "you are missing a semicolon at this point".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yes, no, maybe?&amp;nbsp; Things are what they are.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 23:46:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931072#M366306</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2024-06-05T23:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931073#M366307</link>
      <description>&lt;P&gt;The most reliable way of reviewing&amp;nbsp; code is simply to run it. If you get errors, they could be syntax, logic or system errors. An LLM can only check for syntax errors but never system errors as those are only apparent from running code. LLMs might deal with some obvious logic problems but will never know the difference between what you intended to code for versus what you actually wrote unless you tell it what your use case was to start with.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 00:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931073#M366307</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-06-06T00:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931105#M366323</link>
      <description>&lt;P&gt;I agree that LLM do not do a good job of providing good SAS code, except in the simplest of cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I think there's another problem entirely that LLM doesn't handle at all, but happens quite regularly here in this and other forums. The problem is that people ask the wrong questions, or that people take the wrong approach. This is called the &lt;A href="https://en.wikipedia.org/wiki/XY_problem" target="_self"&gt;XY Problem&lt;/A&gt;, it happens very very often, and LLM models won't address that at all. The XY problem is that someone takes the wrong approach, or an inefficient approach, and then gets stuck coding some hard (or not so hard) part of this wrong approach, and then they come here asking how to solve this code problem. Most of the time, we have to convince the person that there is an easier way that they could approach this problem, and most of the time, the people resist because all they want is how to solve their coding problem, and don't want a different approach or don't want to explain the big picture to us. Most of the time with XY Problems, this leads to very difficult conversations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LLMs will not address this XY Problem. I believe even you,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22691"&gt;@NKormanik&lt;/a&gt;&amp;nbsp;, have had XY Problems here in this forum. No criticism intended here, its just a description of what happens, it seems that almost everyone (including me) does it at some time.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 11:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931105#M366323</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-06T11:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931371#M366420</link>
      <description>&lt;P&gt;The primary problem, so it seems, has to do with &lt;STRONG&gt;macros&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;The art of using macros is a bit tricky?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 05:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931371#M366420</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2024-06-08T05:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931381#M366428</link>
      <description>&lt;P&gt;I would say the learning curve for using the macro language is steeper and longer than learning Base SAS.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I would also say that many (most?) people take the wrong approach (another XY problem) — they try to write a macro from scratch; they should write Base SAS code that works and does what they want for one or two iterations, and only then try to turn that code into a macro. That will be a bazillion times easier than creating a macro from scratch.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 08:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931381#M366428</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-08T08:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931387#M366429</link>
      <description>&lt;P&gt;At PharmaSUG this year, there were, not surprisingly, a ton of papers about LLM's.&amp;nbsp; &amp;nbsp;Searching lexjansen.com for LLM will return plenty of hits&amp;nbsp;&amp;nbsp;&lt;A href="https://www.lexjansen.com/search/searchresults.php?q=LLM" target="_blank"&gt;https://www.lexjansen.com/search/searchresults.php?q=LLM&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One great presentation assessed several LLM's&amp;nbsp; with regard to SAS programming.&amp;nbsp;&amp;nbsp;&lt;A href="https://www.lexjansen.com/pharmasug/2024/AP/PharmaSUG-2024-AP-191.pdf" target="_blank"&gt;https://www.lexjansen.com/pharmasug/2024/AP/PharmaSUG-2024-AP-191.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interestingly, they found Claude to be the best of what they tested, for both error fixing and code explanation:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1717853721266.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97132iEFF8343F805B1E35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1717853721266.png" alt="Quentin_0-1717853721266.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have played just a little with ChatGPT 3.5 and SAS, and haven't been impressed.&amp;nbsp; But when I've played with asking ChatGPT to generate SQL code or to explain SQL code, I've found it to be helpful.&amp;nbsp; One thought I have is that there is much more SQL code on the internet (and python code and R code), than there is SAS code.&amp;nbsp; So the LLM's probably had much more data to train on for those languages.&lt;BR /&gt;&lt;BR /&gt;I'm excited to see what SAS will be able to develop with Viya Copilot.&amp;nbsp; They were showing it in their booth at PharmaSUG, and also it was on stage at SAS Innovate.&amp;nbsp; You can write a comment in your IDE (I forget if they showed VScode or Studio) and ask it to generate SAS code, or highlight a block of code and ask it to generate comments, and do similar stuff.&amp;nbsp; I can't remember which LLM they are using in the background.&amp;nbsp; But I'm assuming SAS has plenty of SAS code to train their models.&amp;nbsp; And since they're obviously focused on training a model that will be good for SAS code generation, but doesn't have to be good for generating blog posts or resumes, I expect it will be much better for SAS code generation / explanation than the general purpose LLM's.&amp;nbsp; Time will tell.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 13:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931387#M366429</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-06-08T13:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931388#M366430</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would say the learning curve for using the macro language is steeper and longer than learning Base SAS.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Definitely true for a person, and I would think maybe even more true for an LLM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my guess that LLM's had a relatively small amount of SAS code to train on is true, then you've got to think they had a miniscule amount of macro language code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A key part of a person learning the macro language is to realize is that it's a *different* language than the SAS language, and that it's a language with the purpose of generating code in another language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So LLM's will be faced with the same challenge of generating text in two different languages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, when I recently asked ChatGPT for some advice about identifying clusters within a time series, it did point me toward a few possible existing PROCS, and at one point it generated a macro.&amp;nbsp; I never tried to compile the macro, but from a quick read it looked like a reasonable attempt.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 14:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931388#M366430</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-06-08T14:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931394#M366434</link>
      <description>&lt;P&gt;"...&lt;SPAN&gt;only then try to turn that code into a macro. That will be a bazillion times easier than creating a macro from scratch."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Likely the LLMs go the macro route from scratch.&lt;BR /&gt;&lt;BR /&gt;LLM, "Piece of cake, boys..."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 22:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931394#M366434</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2024-06-08T22:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931395#M366435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22691"&gt;@NKormanik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;"...&lt;SPAN&gt;only then try to turn that code into a macro. That will be a bazillion times easier than creating a macro from scratch."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Likely the LLMs go the macro route from scratch.&lt;BR /&gt;&lt;BR /&gt;LLM, "Piece of cake, boys..."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I just prompted ChatGPT 3.5 with "You are an expert in SAS programming. Write a utility macro that will act as a function and return the number of records in a dataset."&amp;nbsp; and it returned a pretty nice macro:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro get_record_count(dataset);
    %local dsid nobs result;
    
    %let dsid = %sysfunc(open(&amp;amp;dataset));
    %let nobs = %sysfunc(attrn(&amp;amp;dsid, nobs));
    
    %if &amp;amp;dsid %then %do;
        %let result = &amp;amp;nobs;
        %let dsid = %sysfunc(close(&amp;amp;dsid));
    %end;
    %else %do;
        %put ERROR: Dataset &amp;amp;dataset not found;
        %let result = -1;
    %end;
    
    &amp;amp;result
%mend;

%let count = %get_record_count(sashelp.class);
%put Number of records in dataset: &amp;amp;count;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And it's like magic watching the text appear.&amp;nbsp; But okay, it's text prediction, so maybe not that hard.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I asked about a WHERE option.&amp;nbsp; I asked:&lt;/P&gt;
&lt;PRE&gt;Will it work if I submit:  %let count = %get_record_count(sashelp.class(where=(sex='M'))); &lt;/PRE&gt;
&lt;P&gt;And it correctly answered:&lt;/P&gt;
&lt;PRE&gt;The macro I provided will not work correctly with a WHERE clause as it is currently written. It will return the number of records in the dataset before applying the WHERE condition.&lt;/PRE&gt;
&lt;P&gt;I was surprised by that.&amp;nbsp; But then it went on to write a macro that it said would work with a WHERE option, but it still doesn't honor the WHERE:&lt;/P&gt;
&lt;PRE&gt;To make it work with a WHERE condition, you need to modify the macro to accept the WHERE condition as an additional argument and use it in the appropriate place. Here's the modified macro:&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro get_record_count(dataset, where_condition=);
    %local dsid nobs result;

    %if (%length(&amp;amp;where_condition) &amp;gt; 0) %then %do;
        %let dsid = %sysfunc(open(&amp;amp;dataset(where=(&amp;amp;where_condition))));
    %end;
    %else %do;
        %let dsid = %sysfunc(open(&amp;amp;dataset));
    %end;
    
    %let nobs = %sysfunc(attrn(&amp;amp;dsid, nobs));
    
    %if &amp;amp;dsid %then %do;
        %let result = &amp;amp;nobs;
        %let dsid = %sysfunc(close(&amp;amp;dsid));
    %end;
    %else %do;
        %put ERROR: Dataset &amp;amp;dataset not found;
        %let result = -1;
    %end;
    
    &amp;amp;result
%mend;

%let count = %get_record_count(sashelp.class, where_condition=sex='M');
%put Number of records in dataset: &amp;amp;count;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which is a nice looking macro.&amp;nbsp; And reading it, it really feels like chatgpt is understanding questions, and the code addresses the question.&amp;nbsp; Unfortunately the code doesn't work, but it's reasonable to predict that it would work.&amp;nbsp; The macro will still return 19, because even if you open a dataset with a WHERE option, the attrn(&amp;amp;dsid,nobs) will read the metadata and return the number of records in the dataset ignoring the WHERE condition.&amp;nbsp; (See&amp;nbsp; Jack Hamilton's paper&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi26/p095-26.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi26/p095-26.pdf&lt;/A&gt;&amp;nbsp;for a discussion).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, when I told ChatGPT it didn't work, it kept giving me on variations on the theme which also didn't work.&amp;nbsp; And I almost gave up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I asked "Could using DOSUBL help" and it dropped:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro get_record_count(dataset, where_condition=);
    %local rc result;

    %let rc = %sysfunc(dosubl(%str(
        data _null_;
            if 0 then set &amp;amp;dataset nobs=nobs;
            call symputx('result', nobs);
        run;
    )));

    &amp;amp;result
%mend;

%put Number of records where sex is 'M': %get_record_count(sashelp.class, where_condition=sex='M');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which is an ok guess at how you could try do it with with DOSUBL.&amp;nbsp; It's weird that the where_condition parameter is never used, and it wouldn't work if it was, but it's a reasonable try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for me, when I play with ChatGPT for SAS, it always feels close to being good, but not yet.&amp;nbsp; It's fun because I understand SAS enough to know when it's wrong, and why it's wrong . But it's wrong enough about SAS that I'm hesitant to use it for other languages that I don't know as well, because I feel more likely to be led astray.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 23:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931395#M366435</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-06-08T23:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931659#M366504</link>
      <description>&lt;P&gt;Here's one example.&amp;nbsp; Neither Anthropic's Claude nor ChatGPT can give me a revision that works:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;/********** 05.01 Analyze Duads in Batches **********/&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;%macro analyze_duads_batches;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; %do i = 1 %to &amp;amp;num_batches;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %let start_row = %eval((&amp;amp;i - 1) * 1000 + 1);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %let end_row = %eval(&amp;amp;i * 1000);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; proc sql noprint;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; select duad into :duads_batch separated by ' '&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; from SAS_1.all_duads&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; where row_num between &amp;amp;start_row and &amp;amp;end_row;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; quit;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %put NOTE: Processing batch &amp;amp;i from row &amp;amp;start_row to &amp;amp;end_row;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %analyze_duads_batch(&amp;amp;duads_batch);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; %end;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;%mend;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;/********** 06.01 Analyze Each Duad **********/&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;%macro analyze_duads_batch(duads_batch);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; %let num_duads = %sysfunc(countw(&amp;amp;duads_batch));&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; %do j = 1 %to &amp;amp;num_duads;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %let duad = %scan(&amp;amp;duads_batch, &amp;amp;j);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %let var1 = %scan(&amp;amp;duad, 1, '_');&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %let var2 = %scan(&amp;amp;duad, 2, '_');&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %put NOTE: Analyzing duad &amp;amp;duad with variables &amp;amp;var1 and &amp;amp;var2;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; proc reg data=SAS_1.train_data outest=SAS_1.results_&amp;amp;duad (keep=_RSQ_ _P_);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; model &amp;amp;response_var = &amp;amp;var1 &amp;amp;var2;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; run;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; /* Check for errors and log the message */&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %if &amp;amp;syserr ne 0 %then %do;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; %put ERROR: Regression analysis failed for duad &amp;amp;duad.;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %end;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %else %do;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; %put NOTE: Successfully processed duad &amp;amp;duad. Results stored in SAS_1.results_&amp;amp;duad.;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; %end;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; %end;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;%mend;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;/********** 07.01 Execute Duad Analysis **********/&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;%analyze_duads_batches;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Jun 2024 06:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931659#M366504</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2024-06-11T06:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931678#M366513</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22691"&gt;@NKormanik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here's one example.&amp;nbsp; Neither Anthropic's Claude nor ChatGPT can give me a revision that works:&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You obviously explained a problem to ChatGPT or Claude, and this is the result. Now, explain the problem to us.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 10:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931678#M366513</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-11T10:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931702#M366532</link>
      <description>&lt;P&gt;Looks like yet another "split up the data an loop over data sets" instead of the SAS way of adding a BY variable and using BY group analysis with a single data set. Which wouldn't require a macro at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And would selection of sequential rows into the model really be best? Or random assignment to "batch"?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 13:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931702#M366532</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-06-11T13:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931720#M366539</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Looks like yet another "split up the data an loop over data sets" instead of the SAS way of adding a BY variable and using BY group analysis with a single data set. Which wouldn't require a macro at all.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good point, I didn't even try to figure out what the code was doing. However, this is the exact sort of XY problem that LLMs will not catch, and will lead the user down inefficient paths (if the user can get it to work!)&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 15:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/931720#M366539</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-11T15:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937646#M368427</link>
      <description>&lt;P&gt;I have had excellent success with ChatGPT 4o when comparing it to Claude and Gemini. It is by far the best for SAS code creation, debugging, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have also tried the plug-in for VS Code for SAS so that I may use GitHub's CoPilot, and it's also pretty good, but there were some features that were missing in the plug-in that I needed for my tasks, so I have to abandon it for now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your particular scenario, ChatGPT 4o can debug and work it's way out of logic issues, but the only annoying things right now for me is feeding ChatGPT background information (i.e. characteristics of a dataset, in which I will copy-paste the proc contents into chatgpt) and the lack of an AutoGPT so it can debug and test the code itself without me having to go back-and-forth. If ChatGPT could get better insight into the data structures referenced in my code + AutoGPT, I'd be in heaven.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 17:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937646#M368427</guid>
      <dc:creator>illmatic</dc:creator>
      <dc:date>2024-07-30T17:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937653#M368429</link>
      <description>What is the prompt used?</description>
      <pubDate>Tue, 30 Jul 2024 17:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937653#M368429</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-07-30T17:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937654#M368430</link>
      <description>"I am attempting to... my source dataset is called .... here is the proc contents of said dataset: "pasted proc contents". And then of course it's being as detailed as possible in my explanation and reminding ChatGPT to ask me clarifying questions instead of assuming. Errors of course are copied from the log and pasted back for debugging, additional context is added when I notice that ChatGPT is falling into a logic trap, but that's much rarer now with 4o.</description>
      <pubDate>Tue, 30 Jul 2024 17:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937654#M368430</guid>
      <dc:creator>illmatic</dc:creator>
      <dc:date>2024-07-30T17:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937656#M368431</link>
      <description>Nice, prompts definitely have a big impact on the results in the LLM results. Vague questions get vague responses is very true in LLM. If you can't articulate your problem well, LLMs won't be super effective. &lt;BR /&gt;&lt;BR /&gt;I'm looking at some code specific models (Bamba2) in the near future. Curious to see how those perform.</description>
      <pubDate>Tue, 30 Jul 2024 18:09:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937656#M368431</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-07-30T18:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: LLM to review SAS coding?  Which is best?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937700#M368433</link>
      <description>&lt;P&gt;Similar to talking with a human:&amp;nbsp; If you use grade school talk, you don't get far.&amp;nbsp; If you use post grad talk, you get lots further.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ChatGPT and Claude are able to carry on quite well at the post grad level.&amp;nbsp; Not true of most humans.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 02:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LLM-to-review-SAS-coding-Which-is-best/m-p/937700#M368433</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2024-07-31T02:20:28Z</dc:date>
    </item>
  </channel>
</rss>

