<?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 DI Studio Parameter From SAS Dataset in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454572#M14022</link>
    <description>&lt;P&gt;When building a job in DI Studio, I require a job level parameter. However, I don't want to simply hardcode a default but read a value (year) off of a SAS dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When opening the 'New Prompt' in job level properties, and selecting the 'Prompt Type and Values' tab, I can select 'Data source item' as a Prompt Type. This enables me to browse to the desired SAS table as a data source, select a data type (numeric), then select one of the numeric columns off the table. This all seems to appear as if I've selected a dataset, and a specific column off of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is exactly what I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when I run a job, use the &amp;amp;parameter as the value of a workfile column (to test) I get a message that:&lt;/P&gt;
&lt;P&gt;"The following columns were not found in the contributing tables: [column_name]"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have I missed? I would expect any time I use &amp;amp;parameter within this job it would have the year value I pointed to on that other table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;-Jeff&lt;/P&gt;</description>
    <pubDate>Mon, 16 Apr 2018 20:47:38 GMT</pubDate>
    <dc:creator>jwhite</dc:creator>
    <dc:date>2018-04-16T20:47:38Z</dc:date>
    <item>
      <title>DI Studio Parameter From SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454572#M14022</link>
      <description>&lt;P&gt;When building a job in DI Studio, I require a job level parameter. However, I don't want to simply hardcode a default but read a value (year) off of a SAS dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When opening the 'New Prompt' in job level properties, and selecting the 'Prompt Type and Values' tab, I can select 'Data source item' as a Prompt Type. This enables me to browse to the desired SAS table as a data source, select a data type (numeric), then select one of the numeric columns off the table. This all seems to appear as if I've selected a dataset, and a specific column off of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is exactly what I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when I run a job, use the &amp;amp;parameter as the value of a workfile column (to test) I get a message that:&lt;/P&gt;
&lt;P&gt;"The following columns were not found in the contributing tables: [column_name]"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have I missed? I would expect any time I use &amp;amp;parameter within this job it would have the year value I pointed to on that other table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;-Jeff&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 20:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454572#M14022</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2018-04-16T20:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio Parameter From SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454633#M14029</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I feel your confusion. But as far as my understanding, prompts in DI Studio is of use only when you are deploying a job as a Stored Process. There is no prompts functionality when you are running a job within DI Studio client, not in batch.&lt;/P&gt;
&lt;P&gt;If you select a default value I assume you'll get a proper value during execution.&lt;/P&gt;
&lt;P&gt;If you want to feed your job with a value based on a lookup table there are several other options:&lt;/P&gt;
&lt;P&gt;- Use a loop transform, which will et you feed the inner (original) job with a parameter table.&lt;/P&gt;
&lt;P&gt;- Use a logic in autoexec or Pre-process to read the table and assign thr macro variable&lt;/P&gt;
&lt;P&gt;- Have the parameter table as a part of the job and lookup/join in it'sd value. Not very neat since there's probably no join column.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 06:40:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454633#M14029</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-04-17T06:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio Parameter From SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454818#M14040</link>
      <description>&lt;P&gt;Hi Linus,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, we don't deploy our jobs as Stored Processes.&lt;/P&gt;
&lt;P&gt;I am curious...instead of building a macro, can we build code in a User Written Code transformation and include that transformation in the job. Code within that transformation that would go look at a year value on a SAS dataset and load it as a job level parameter to be used in any needed nodes within the job?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;-Jeff&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 16:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454818#M14040</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2018-04-17T16:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio Parameter From SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454960#M14043</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20678"&gt;@jwhite&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;It's the LOOP transformation which allows you OOTB to use a control table and then call an inner job once per observation in the control table passing the values as parameters to the inner job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If using a scheduler/batch command then you can also pass in parameters via the batch command line (within the code then available as macro variable).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....or you just have a user written code node (or if used in multiple jobs a custom transformation) which reads your table and creates a macro variable for later use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 23:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/454960#M14043</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-04-17T23:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio Parameter From SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/455123#M14045</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;, it's the latter option that I'm interested in doing...creating a transformation that will read a table and create a macro variable that can be used as a parameter in jobs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not a SAS programmer by trade (yet), so still working through the kinks on how to do it. Any tips? Particularly, in setting up a macro variable to be used as a parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 12:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/455123#M14045</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2018-04-18T12:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio Parameter From SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/455411#M14055</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20678"&gt;@jwhite&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;That's how you can create and populate a macro variable from data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/** option 1 **/
%let age=;
proc sql noprint;
  select put(age,5. -l) into :age
  from sashelp.class
  where name='Alfred'
  ;
quit;

%put Age is: &amp;amp;age;

/** option 2 **/
%let age2=;
data _null_;
  set sashelp.class;
  if name='Alfred';
  call symputx('age2',put(age,5.));
  stop;
run;
%put Age2 is: &amp;amp;age2;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 21:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/455411#M14055</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-04-18T21:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio Parameter From SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/455924#M14072</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;, thank you!&lt;/P&gt;
&lt;P&gt;I was able to tweak that code a bit to get what I needed for our purpose. For anyone interested, I ended up with:&lt;/P&gt;
&lt;PRE&gt;LIBNAME [libname] "[path]";
%let [variable]=;
data _null_ ;
  set [libname].[table];
  call symputx ('[variable]', put([table column], 8.));
run;
%put value is: &amp;amp;[variable];&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Parameter-From-SAS-Dataset/m-p/455924#M14072</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2018-04-20T14:19:38Z</dc:date>
    </item>
  </channel>
</rss>

