<?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: Trying to use MEMNAME in order to print all data sets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105565#M29440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, memname is a variable in dataview sashelp.vcolumn. In your put statement, the word memname is simply a part of a string. It is not going to be replaced by the value of memname (the name of the dataset).&amp;nbsp; Investigate how the put statement could write the value of memnage instead of the word memname itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 May 2012 01:23:14 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2012-05-06T01:23:14Z</dc:date>
    <item>
      <title>Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105564#M29439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; So I have this problem on my homework assignment where I need to write a proc print statement using sashelp.vcolumns dictionary to print all of the datasets that contain Product_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This is my code so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set sashelp.vcolumn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where libname='ORION' and name='Product_ID';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; file 'C:\SAS\print_products.sas';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put 'proc print data=orion.memname (obs=5);';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put 'run;';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%include 'C:\SAS\print_products.sas' /source2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Unfortunately, so far I am not successful with this code and I know it's because I am not not familiar with how to use memname.&lt;/P&gt;&lt;P&gt; Could someone please take a look at my code and let me know where I am going wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2012 01:13:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105564#M29439</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-05-06T01:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105565#M29440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, memname is a variable in dataview sashelp.vcolumn. In your put statement, the word memname is simply a part of a string. It is not going to be replaced by the value of memname (the name of the dataset).&amp;nbsp; Investigate how the put statement could write the value of memnage instead of the word memname itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2012 01:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105565#M29440</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-06T01:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105566#M29441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello PG,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Do you have any suggestions on where I could start to look for that information?&lt;/P&gt;&lt;P&gt; I have tried to search on Google and within the SAS help docs and I have not come up with anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2012 02:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105566#M29441</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-05-06T02:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105567#M29442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alisa,&lt;/P&gt;&lt;P&gt;If you don't have to use " put", you can try my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select memname into :dsn separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.vcolumn&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where libname='ORION' and name='Product_ID';&lt;/P&gt;&lt;P&gt; quit;&lt;/P&gt;&lt;P&gt; %put &amp;amp;dsn;&lt;/P&gt;&lt;P&gt; %macro print;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %do i=1 %to %sysfunc(countw(&amp;amp;dsn));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; proc print data=orion.%scan(&amp;amp;dsn,&amp;amp;i)(obs=5);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt; %mend;&lt;/P&gt;&lt;P&gt; %print&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2012 02:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105567#M29442</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-05-06T02:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105568#M29443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at the description of the put statement in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0jcwhe1ofmb49n1xf1q2kc44b0v.htm"&gt;http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0jcwhe1ofmb49n1xf1q2kc44b0v.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2012 02:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105568#M29443</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-06T02:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105569#M29444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you PG for the info!&lt;/P&gt;&lt;P&gt;Alisa, first read the link PG provided. If you can't figure out after reading, then use "&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ffcc00;"&gt;put 'proc print data=orion.'memname '(obs=5);';&lt;/SPAN&gt;" to modify your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2012 03:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105569#M29444</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-05-06T03:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105570#M29445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Linlin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This did get me a little bit further in my code, but I kept getting the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;225 +proc print data=orion."memname" (obs=5);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 76&lt;/P&gt;&lt;P&gt;ERROR: Invalid data set name orion..&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, BLANKLINE, DATA, DOUBLE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HEADING, LABEL, N, NOOBS, OBS, ROUND, ROWS, SPLIT, STYLE, SUMLABEL, UNIFORM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WIDTH.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;226 +run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have any suggestions on how to improve this, that would be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 17:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105570#M29445</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-05-07T17:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105571#M29446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alisa,&lt;/P&gt;&lt;P&gt;I tried your code and it worked perfectly after unquote &lt;SPAN style="color: #ff0000;"&gt;memname&lt;/SPAN&gt;. Please try the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set sashelp.vcolumn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where libname='ORION' and name='Product_ID';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; file 'C:\SAS\print_products.sas';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put &lt;SPAN style="color: #ff0000;"&gt;'proc print data=orion.'&lt;/SPAN&gt; memname &lt;SPAN style="color: #ff0000;"&gt;'(obs=5);'&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put 'run;';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%include 'C:\SAS\print_products.sas' /source2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 18:09:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105571#M29446</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-05-07T18:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105572#M29447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alisa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, let's see if we are answering the right question.&amp;nbsp; Which of these do you need to do?&amp;nbsp; From the ORION library:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Print the name of every data set that contain Product_ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Print the first 5 observations from every data set that contains Product_ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Print some other information about every data set that contains Product_ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the question is clear, we can patch up the solution.&amp;nbsp; It looks like you have been trying to solve question 2, but I'm not convinced that is the right thing to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 18:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105572#M29447</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-05-07T18:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105573#M29448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Linlin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This worked perfectly. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 18:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105573#M29448</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-05-07T18:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105574#M29449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Astounding,&lt;/P&gt;&lt;P&gt;This is how I tested Alisa's code. I think it solved "2. Print the first 5 observations from every data set that contains Product_ID?".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test1 test2 test3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set sashelp.vcolumn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where libname='WORK' and name='i';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; file 'C:\temp\forum\print_products.sas';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put 'proc print data=work.' memname '(obs=5);';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put 'run;';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%include 'C:\temp\forum\print_products.sas' /source2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 18:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105574#M29449</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-05-07T18:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105575#M29450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Linlin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If question 2 is the right one, your code is a good start.&amp;nbsp; The only change I would suggest is in the WHERE statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where libname='WORK' and upcase(name)='I';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is possible that Product_ID takes on a variety of capitalizations in various data sets.&amp;nbsp; The code you posted will run without error, but that might be deceptive.&amp;nbsp; It is possible that there would be additional data sets that contain PRODUCT_ID, for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one of the other questions is the right one, the program becomes even simpler.&amp;nbsp; But I would wait to hear from Alisa before trying to change the question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited:&amp;nbsp;&amp;nbsp; One more change I forgot to mention:&amp;nbsp; I would add a PUT statement to write a TITLE statement that contains the name of the data set being printed.&amp;nbsp; As it stands, that's key information that is not included in the report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 18:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105575#M29450</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-05-07T18:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105576#M29451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! using upcase is very important.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 19:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105576#M29451</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-05-07T19:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105577#M29452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; set sashelp.vcolumn;&lt;/P&gt;&lt;P&gt; where libname='WORK' and upcase(name)='NAME';&lt;/P&gt;&lt;P&gt; call execute('title "' || catx('.',libname,memname) || '";');&lt;/P&gt;&lt;P&gt; call execute('proc print data=' || catx('.',libname,memname) || '(obs=5); run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 21:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105577#M29452</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-05-07T21:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105578#M29453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FriedEgg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a way, you are absolutely right.&amp;nbsp; I would have done it something like that, except that I'm working with an older version of SAS that doesn't have the CAT functions.&amp;nbsp; (That will change later this month.&amp;nbsp; yay!)&amp;nbsp; But there are ways around using the CAT functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original poster was having trouble getting the proper syntax for a PUT statement.&amp;nbsp; I wouldn't add the burden of learning CALL EXECUTE under those conditions.&amp;nbsp; While I think your solution is better, I try to stick to solutions that the poster will understand, even if I think another solution is better.&amp;nbsp; All that being said, I wouldn't be surprised if the actual question should have been different and the answer should have been:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=sashelp.vcolumn;&lt;/P&gt;&lt;P&gt;where libname='ORION' and upcase(name) = 'PRODUCT_ID';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 21:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105578#M29453</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-05-07T21:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use MEMNAME in order to print all data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105579#M29454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is my belief that call execute is much simpler than using file, put and %include both to understand and to write.&amp;nbsp; Of course, everyone is entitled to their opinions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 21:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-use-MEMNAME-in-order-to-print-all-data-sets/m-p/105579#M29454</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-05-07T21:26:48Z</dc:date>
    </item>
  </channel>
</rss>

