<?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: Extracting the variable names in a SAS code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-the-variable-names-in-a-SAS-code/m-p/911542#M359441</link>
    <description>&lt;P&gt;It wouldn't be hard to write such a script.&lt;/P&gt;
&lt;P&gt;What I would do: Download and open all these 40 .sas files with Notepad++ and do the search there (Notepad++ also allows for RegEx searches). I used to use Atom in the past for such impact analysis - but it has unfortunately been discontinued.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jan 2024 04:56:39 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2024-01-15T04:56:39Z</dc:date>
    <item>
      <title>Extracting the variable names in a SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-the-variable-names-in-a-SAS-code/m-p/911539#M359440</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have been given a set of sas scripts (40 odd scripts) written in SAS without documentation of the inter-relationships between the .SAS files.&lt;/P&gt;&lt;P&gt;I am not trying to reverse engineer it but just trying to understand the derivation of certain variables of interest only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg&amp;nbsp;&lt;/P&gt;&lt;P&gt;if P26v = 1 then mb1 = 1;&lt;BR /&gt;else if P26u IN(5,8,9) or M26v = 5 then md6 = 5;&lt;BR /&gt;else mb1 = D26v;&lt;/P&gt;&lt;P&gt;if P26Q = 1 or P26W = 1 or P26P = 1 then md8 = 1;&lt;BR /&gt;else if M26A = 5 or M26F = 7 or P26P = 3 then md8 = 2;&lt;BR /&gt;else if P26Q = 8 or D26W = 8 or D26R = 8 then md8 = 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would like to extract out the lines&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;else if P26u IN(5,8,9) or M26v = 5 then md6 = 5;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;else if M26A = 5 or M26F = 7 or P26P = 3 then md8 = 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;may i know is there a script where i can run such that i can specify regular expression&amp;nbsp;&lt;SPAN&gt;'/\bM\w+/' and the lines that contains a variable starting with M followed by some numberic can be extracted ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I used chatgrp for help but it is not working out for me. I only manage to get the script to iterate all the .SAS files but the part to look for variable of specific pattern is just not working out for me. I wish to seek some advice how can i go about it please.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BY&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 03:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-the-variable-names-in-a-SAS-code/m-p/911539#M359440</guid>
      <dc:creator>Yiang</dc:creator>
      <dc:date>2024-01-15T03:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting the variable names in a SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-the-variable-names-in-a-SAS-code/m-p/911542#M359441</link>
      <description>&lt;P&gt;It wouldn't be hard to write such a script.&lt;/P&gt;
&lt;P&gt;What I would do: Download and open all these 40 .sas files with Notepad++ and do the search there (Notepad++ also allows for RegEx searches). I used to use Atom in the past for such impact analysis - but it has unfortunately been discontinued.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 04:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-the-variable-names-in-a-SAS-code/m-p/911542#M359441</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-15T04:56:39Z</dc:date>
    </item>
  </channel>
</rss>

