<?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: Need guidance for best way to capture user entered prompts and create table for report. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261467#M50897</link>
    <description>&lt;P&gt;How is a work table different from a data set?&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2016 16:22:34 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-04-05T16:22:34Z</dc:date>
    <item>
      <title>Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261444#M50887</link>
      <description>&lt;P&gt;I am working on reports where the users may enter up to 20+ prompt filters.&amp;nbsp;&amp;nbsp; What I need to do is create a work table that would included column names for 'Prompt1_ColName',&amp;nbsp; 'Prompt1_Value', 'Prompt2_ColName',&amp;nbsp; 'Prompt2_Value'... and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am testing the length of the prompts to check if a value&amp;nbsp;has been entered.&amp;nbsp;&amp;nbsp;I would like to create a work table that contains these&amp;nbsp;values so I can use it for reporting.&amp;nbsp; Not sure about best way to create the work&amp;nbsp;table.&amp;nbsp; I have only created tables using select queries.&amp;nbsp; In looking at using&amp;nbsp;a data step, it looks like tthis is only for creating datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any direction would be greatly appreciated!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 15:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261444#M50887</guid>
      <dc:creator>ncsthbell</dc:creator>
      <dc:date>2016-04-05T15:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261453#M50891</link>
      <description>&lt;P&gt;Option1: If you are using SAS Enterprise Guide, there is a capability called "Prompt Manager" that provides the capability to display prompts to the user at run time. These prompts are stored as global macro variables which can be used throughout the session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option2: Create a confi sas program which is executed 1st using %LET = for each user prompt, thereby storing the prompt values in g&lt;SPAN&gt;lobal macro variables which can be used throughout the session.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Option3: Create a reference sas dataset with prompt names and values and read the values into&amp;nbsp;global macro variables which can be used throughout the session.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 15:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261453#M50891</guid>
      <dc:creator>daddio42</dc:creator>
      <dc:date>2016-04-05T15:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261459#M50894</link>
      <description>&lt;P&gt;Regardless of the method you choose, I would suggest changing the structure.&amp;nbsp; It will be much more flexible to use 20+ records, each with 3 columns:&amp;nbsp; prompt_no (1-20), prompt_name, prompt_value.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 15:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261459#M50894</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-05T15:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261462#M50895</link>
      <description>&lt;P&gt;Hello ddadio42,&lt;/P&gt;
&lt;P&gt;Option1 - I am not using EG, use SAS Base code&lt;/P&gt;
&lt;P&gt;Option2 -&amp;nbsp;I am currently using a %Let statement in my code to create a global variable for each prompt.&lt;/P&gt;
&lt;P&gt;Option3 - I would prefer not to create a dataset that holds the prompt values as there will be many users of these reports and I don't want to have any conflicts with the dataset.&amp;nbsp; That is why I want to build a work table.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261462#M50895</guid>
      <dc:creator>ncsthbell</dc:creator>
      <dc:date>2016-04-05T16:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261464#M50896</link>
      <description>&lt;P&gt;Astounding,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you stated is exactly what I am doing, however, I just can't figure out how to get each row into a work table, not a dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261464#M50896</guid>
      <dc:creator>ncsthbell</dc:creator>
      <dc:date>2016-04-05T16:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261467#M50897</link>
      <description>&lt;P&gt;How is a work table different from a data set?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261467#M50897</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-05T16:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261473#M50899</link>
      <description>&lt;P&gt;Doesn't a sas dataset have to have a physical permanent location where a work table is on the sas server?&amp;nbsp; I have not worked with SAS datasets either, only SAS tables.&amp;nbsp;&amp;nbsp; So, for that reason I also thought it would be better for me to use a work table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to take this table and use as source into a proc report.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261473#M50899</guid>
      <dc:creator>ncsthbell</dc:creator>
      <dc:date>2016-04-05T16:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261477#M50901</link>
      <description>&lt;P&gt;OK ... not always ... but I see where you are coming from.&amp;nbsp; There are permanent SAS data sets and temporary SAS data sets (stored in the WORK area), which use the same structure.&amp;nbsp; If you wanted to keep the SAS data sets permanently, but distinguish which one belonged to which user, you might name them perm._&amp;amp;sysuserid (assuming that &amp;amp;sysuserid contains legal characters for a data set name).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moving from macro variables to a data set might require defining a macro, to be able to use a %DO loop.&amp;nbsp; But it could be done along these lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;%do i=1 %to 20;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; col_no = &amp;amp;i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; col_name = "prompt&amp;amp;i._colname";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; col_value = "prompt&amp;amp;i._value";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code makes the names and values character.&amp;nbsp; If COL_VALUE is character some of the time, it has to be character all the time.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 17:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261477#M50901</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-05T17:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261482#M50903</link>
      <description>&lt;P&gt;What about SYMGET?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Moving from macro variables to a data set might require defining a macro, to be able to use a %DO loop.&amp;nbsp; But it could be done along these lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 05 Apr 2016 17:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261482#M50903</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-04-05T17:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need guidance for best way to capture user entered prompts and create table for report.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261483#M50904</link>
      <description>&lt;P&gt;Good idea.&amp;nbsp; SYMGET would work nicely here.&amp;nbsp; You could use a DATA step DO loop (containing an OUTPUT statement) instead of a macro loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, you will need to pay attention to the lengths of the variables.&amp;nbsp; SYMGET handles that automatically, creating character variables that are $200 long.&amp;nbsp; My code uses the length of the first prompt entered, which may be too short for later prompts.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 17:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-guidance-for-best-way-to-capture-user-entered-prompts-and/m-p/261483#M50904</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-05T17:52:36Z</dc:date>
    </item>
  </channel>
</rss>

