<?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: Extract a specific row and column from dataset and assign to a global varriable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499555#M166</link>
    <description>Thank you.</description>
    <pubDate>Thu, 27 Sep 2018 15:32:09 GMT</pubDate>
    <dc:creator>amit7urmc</dc:creator>
    <dc:date>2018-09-27T15:32:09Z</dc:date>
    <item>
      <title>Extract a specific row and column from dataset and assign to a global varriable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499543#M160</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I access a specific row and column from a dataset and save it to a global variable for later use? for example from sashelp.cars dataset how do I get first row value for 'Make' column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro ExtractACell(rownum=1, VarName='Make');
	data work.TempDelete;
		set sashelp.cars;
		if _n_ = &amp;amp;rownum then
			do;
				%global MyVar;
				MyVar = ????? *Code to get the Make value from the first row and save to MyVar
			end;
	run;
%mend ExtractACell;

%put &amp;amp;MyVar *&amp;lt;-- Is this correct&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499543#M160</guid>
      <dc:creator>amit7urmc</dc:creator>
      <dc:date>2018-09-27T15:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a specific row and column from dataset and assign to a global varriable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499548#M161</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can do it for example like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro ExtractACell(rownum=1, VarName=Make);
	data _null_;
		set sashelp.cars(obs=&amp;amp;rownum. firstobs=&amp;amp;rownum. keep = &amp;amp;VarName.);	
		call symputx('MyVar', &amp;amp;VarName., "G");
        stop;
	run;
%mend ExtractACell;

%ExtractACell(rownum=7, VarName=Model)

%put &amp;amp;MyVar.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499548#M161</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2018-09-27T15:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a specific row and column from dataset and assign to a global varriable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499549#M162</link>
      <description>&lt;P&gt;You’re missing the CALL SYMPUTX() to create the macro variable. YOu may want to also use the FIRSTOBS and OBS data set options to read only a single line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;set sashelp.cars(obs=&amp;amp;rownum firstobs=&amp;amp;rownum);&lt;/P&gt;
&lt;P&gt;call symputx(‘myVar’, &amp;amp;varName, ‘g’);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;myVar;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499549#M162</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-27T15:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a specific row and column from dataset and assign to a global varriable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499554#M165</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499554#M165</guid>
      <dc:creator>amit7urmc</dc:creator>
      <dc:date>2018-09-27T15:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a specific row and column from dataset and assign to a global varriable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499555#M166</link>
      <description>Thank you.</description>
      <pubDate>Thu, 27 Sep 2018 15:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-a-specific-row-and-column-from-dataset-and-assign-to-a/m-p/499555#M166</guid>
      <dc:creator>amit7urmc</dc:creator>
      <dc:date>2018-09-27T15:32:09Z</dc:date>
    </item>
  </channel>
</rss>

