<?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: Call symputx and infile datalines in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437453#M108919</link>
    <description>Definitely! Thank you!</description>
    <pubDate>Thu, 15 Feb 2018 08:50:43 GMT</pubDate>
    <dc:creator>DmytroYermak</dc:creator>
    <dc:date>2018-02-15T08:50:43Z</dc:date>
    <item>
      <title>Call symputx and infile datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437448#M108916</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help to tune-up the program with 'call symputx'. The macrovariables are not initialized and I don't understand the reason:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint mlogic;
data denoms;
 length PARAMN 8 PARAMCD DENOM $200;
 infile datalines dsd dlm = "@";
 input PARAMN PARAMCD DENOM;
 call symputx(compress(PARAMCD||put(_N_,best.)),PARAMCD);
 call symputx(compress(DENOM||put(_N_,best.)),DENOM);
datalines;
11 @ AUCIFO	@	0
12 @ AUCLST	@	0
13 @ CMAX	@	0
14 @ TMAX	@	2
15 @ LAMZ	@	4
16 @ LAMZHL	@	1
21 @ CLFO	@	2
22 @ VZFO	@	0
31 @ CLO	@	2
32 @ VZO	@	0
33 @ VSSO	@	0
34 @ AUMCLST	@	0
35 @ AUMCIFO	@	0
36 @ MRTIVLST	@	1
41 @ AUCTAU	@	0
42 @ CMIN	@	0
43 @ CTROUGH	@	0
44 @ CAVG	@	0
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 08:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437448#M108916</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-02-15T08:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Call symputx and infile datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437452#M108918</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;You forgot the quotes in the first argument of symputx&lt;BR /&gt;&lt;BR /&gt; call symputx(compress("PARAMCD"||put(_N_,best.)),PARAMCD);&lt;BR /&gt; call symputx(compress("DENOM"||put(_N_,best.)),DENOM);</description>
      <pubDate>Thu, 15 Feb 2018 08:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437452#M108918</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-02-15T08:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Call symputx and infile datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437453#M108919</link>
      <description>Definitely! Thank you!</description>
      <pubDate>Thu, 15 Feb 2018 08:50:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437453#M108919</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-02-15T08:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call symputx and infile datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437460#M108922</link>
      <description>&lt;P&gt;Thats really not a good way to go, remember macro is&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/U&gt; a replacement for Base SAS.&amp;nbsp; You have data in one table, you need to use this in another table, then you merge the data from one onto another.&amp;nbsp; This is a very simple and common process that is used in almost every program, do not try to ignore that and write macro code to do the same thing.&amp;nbsp; Thousands of lines of dodgy macro code, or a simple merge statement by paramcd...&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 09:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437460#M108922</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-15T09:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Call symputx and infile datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437483#M108934</link>
      <description>&lt;P&gt;Hi RW9,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I completely agree that code should not be complicated&amp;nbsp;unless absolutely necessary. But please have a look where the macrovariables are used further:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro num_to_char;
%do i = 1 %to 18;
  if PARAMCD in ("&amp;amp;&amp;amp;PARAMCD&amp;amp;i.") then do;&lt;BR /&gt;&lt;BR /&gt;                                         QVAL_Mean_C = put(QVAL_Mean,16.%eval(&amp;amp;&amp;amp;DENOM&amp;amp;i.+1)-L);
					QVAL_StdDev_C = put(QVAL_StdDev,16.%eval(&amp;amp;&amp;amp;DENOM&amp;amp;i.+2)-L);
					QVAL_Min_C = put(QVAL_Min,16.&amp;amp;&amp;amp;DENOM&amp;amp;i.-L);
					QVAL_Median_C = put(QVAL_Median,16.%eval(&amp;amp;&amp;amp;DENOM&amp;amp;i.+1)-L);
					QVAL_Max_C = put(QVAL_Max,16.&amp;amp;&amp;amp;DENOM&amp;amp;i.-L);&lt;BR /&gt;
				      end;  
%end;
%mend num_to_char;

data tableX ; 
  format QVAL_Mean_C QVAL_StdDev_C QVAL_Min_C QVAL_Median_C QVAL_Max_C $200.;
  set proc_mean_results;
  NObs_C = put(NObs,16.0-L);  
    %macro num_to_char;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The list of parameters or the number of decimals can be changed anytime. I hope that using of the approach outlined can help to react faster.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 10:14:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437483#M108934</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-02-15T10:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Call symputx and infile datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437489#M108937</link>
      <description>&lt;P&gt;Exactly the code I would avoid like the plague, lists of data, loops all kinds of things, all of which will go wrong at some point.&amp;nbsp; An example of using merge:&lt;/P&gt;
&lt;PRE&gt;data want (drop=denom);
  merge lab_data param_data;
  by paramcd;
  qval_stddev_c=putn(qval_stddev,16,denom);
  ...
run;&lt;/PRE&gt;
&lt;P&gt;So much simpler and expandable as any dataset is.&amp;nbsp; Also note that by the use of paramcd I assume your using either LAB model, LB domain, or an ADaM BDS structure.&amp;nbsp; For LAB, LB precision should already be a variable, and for ADaM, this should be present in some form or other, perhaps already rounded?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 10:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437489#M108937</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-15T10:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Call symputx and infile datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437498#M108943</link>
      <description>Thank you for the code. Actually I didn't know about "putn" where one can declare decimals using varialbes value. Your approach is definitely simpler.</description>
      <pubDate>Thu, 15 Feb 2018 10:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-symputx-and-infile-datalines/m-p/437498#M108943</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-02-15T10:48:11Z</dc:date>
    </item>
  </channel>
</rss>

