<?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: Adding new line while using catx in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-new-line-while-using-catx/m-p/357788#M84044</link>
    <description>&lt;P&gt;Sorry, your post is not clear. &amp;nbsp;&lt;STRONG&gt;Post test data, in the form of a datastep. &amp;nbsp;&lt;/STRONG&gt;Also post what you want out at the end. &amp;nbsp;Why for instance are you taking data from a datastep and putting it and formatting values into a macro variable? &amp;nbsp;Its likely your hitting a length issue, but really can't tell what you trying to do at all. &amp;nbsp;If you want some sort of list then:&lt;/P&gt;
&lt;PRE&gt;data y;
  set result (where=(total_record_count gt 10.00 or total_record_count lt -10.00)) end=last;
  length r final $2000;
  retain final;
  r=catx(":","CDE",cde_name,"Attribute",attrib_name);
  final=ifc(_n_=1,r,catx(":",final,r));
  if last then call symputx('VAR',final);
run;
&lt;/PRE&gt;
&lt;P&gt;However that really isn't a good way to do things, you will hit line var lengths and your code will be all spaghetti.&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2017 08:43:24 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-05-11T08:43:24Z</dc:date>
    <item>
      <title>Adding new line while using catx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-new-line-while-using-catx/m-p/357775#M84040</link>
      <description>&lt;P&gt;Hi I want to add line while concatenating variables. tried a few things. Dont seem to get it done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;		DATA Y;
		SET result;
		INFORMAT R $100.;
		format R $100.;
		R = CATX(":" ,"CDE" , cde_name, "Attribute", attrib_name);
 		where total_record_count gt 10.00 or total_record_count lt -10.00;	
		RUN;
		PROC PRINT;
		title 'Y';
		RUN;


		proc sql;
		select (catx("^{newline 1}",R)) into :var separated by '^{newline 1}' from y 
		where total_record_count gt 10.00 or total_record_count lt -10.00;
		run;&lt;/PRE&gt;&lt;PRE&gt;Now I only get CDE:PRODUCT HIERARCHY:Attribute:PRD_HRCHY_LVL_2_CDE^{newline 1}CDE:PRODUCT&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 May 2017 07:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-new-line-while-using-catx/m-p/357775#M84040</guid>
      <dc:creator>sreeparna93</dc:creator>
      <dc:date>2017-05-11T07:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new line while using catx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-new-line-while-using-catx/m-p/357788#M84044</link>
      <description>&lt;P&gt;Sorry, your post is not clear. &amp;nbsp;&lt;STRONG&gt;Post test data, in the form of a datastep. &amp;nbsp;&lt;/STRONG&gt;Also post what you want out at the end. &amp;nbsp;Why for instance are you taking data from a datastep and putting it and formatting values into a macro variable? &amp;nbsp;Its likely your hitting a length issue, but really can't tell what you trying to do at all. &amp;nbsp;If you want some sort of list then:&lt;/P&gt;
&lt;PRE&gt;data y;
  set result (where=(total_record_count gt 10.00 or total_record_count lt -10.00)) end=last;
  length r final $2000;
  retain final;
  r=catx(":","CDE",cde_name,"Attribute",attrib_name);
  final=ifc(_n_=1,r,catx(":",final,r));
  if last then call symputx('VAR',final);
run;
&lt;/PRE&gt;
&lt;P&gt;However that really isn't a good way to do things, you will hit line var lengths and your code will be all spaghetti.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 08:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-new-line-while-using-catx/m-p/357788#M84044</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-11T08:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new line while using catx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-new-line-while-using-catx/m-p/357810#M84046</link>
      <description>&lt;P&gt;Don't keep lists in macro variables. Keep them in datasets. It is much easier to create line-separated output with proc print or a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What for would you use such a macro variable, anyway?&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 10:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-new-line-while-using-catx/m-p/357810#M84046</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-11T10:29:11Z</dc:date>
    </item>
  </channel>
</rss>

