<?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 User defined formats in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374423#M24376</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I have a problem on creation user defined formats.&lt;/P&gt;&lt;P&gt;So, I try to create my own formats by using my dataset and want to add to the last row the "Not Found" values, but my code deletes the last rows and adds the "Not Found" statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give me a hint. the code is below;&lt;/P&gt;&lt;PRE&gt;data control_format /view=control_format;
		
	set cuserv.ABC_General (drop=Quantity Retail_Price
                             rename=(N_Item_Name = Start
                                     Class = Label))
				            end = last;
		retain fmtname '$mdclass'
		       Type 'C';

			   if last then do;
			   Start = ' ';
			   HLO = 'O';
			   Label = 'Not Found';
			   end;
 
 run;


 proc format cntlin=control_format fmtlib;
 run;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Jul 2017 10:12:39 GMT</pubDate>
    <dc:creator>Garik</dc:creator>
    <dc:date>2017-07-10T10:12:39Z</dc:date>
    <item>
      <title>User defined formats</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374423#M24376</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I have a problem on creation user defined formats.&lt;/P&gt;&lt;P&gt;So, I try to create my own formats by using my dataset and want to add to the last row the "Not Found" values, but my code deletes the last rows and adds the "Not Found" statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give me a hint. the code is below;&lt;/P&gt;&lt;PRE&gt;data control_format /view=control_format;
		
	set cuserv.ABC_General (drop=Quantity Retail_Price
                             rename=(N_Item_Name = Start
                                     Class = Label))
				            end = last;
		retain fmtname '$mdclass'
		       Type 'C';

			   if last then do;
			   Start = ' ';
			   HLO = 'O';
			   Label = 'Not Found';
			   end;
 
 run;


 proc format cntlin=control_format fmtlib;
 run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 10:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374423#M24376</guid>
      <dc:creator>Garik</dc:creator>
      <dc:date>2017-07-10T10:12:39Z</dc:date>
    </item>
    <item>
      <title>User-Defined Formats</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374425#M24378</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I have a problem on creation user defined formats.&lt;/P&gt;&lt;P&gt;So, I try to create my own formats by using my dataset and want to add to the last row the "Not Found" values, but my code deletes the last rows and adds the "Not Found" statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give me a hint. the code is below;&lt;/P&gt;&lt;PRE&gt;data control_format /view=control_format;
		
	set cuserv.ABC_General (drop=Quantity Retail_Price
                             rename=(N_Item_Name = Start
                                     Class = Label))
				            end = last;
		retain fmtname '$mdclass'
		       Type 'C';

			   if last then do;
			   Start = ' ';
			   HLO = 'O';
			   Label = 'Not Found';
			   end;
 
 run;


 proc format cntlin=control_format fmtlib;
 run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 10:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374425#M24378</guid>
      <dc:creator>Garik</dc:creator>
      <dc:date>2017-07-10T10:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: User-Defined Formats</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374426#M24379</link>
      <description>&lt;P&gt;If that's the only roadblock, it's easy to overcome. &amp;nbsp;Add an OUTPUT statement in two places:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data control_format /view=control_format;
		
	set cuserv.ABC_General (drop=Quantity Retail_Price
                             rename=(N_Item_Name = Start
                                     Class = Label))
				            end = last;
		retain fmtname '$mdclass'
		       Type 'C';
                           &lt;FONT color="#FF0000"&gt;output;&lt;/FONT&gt;
			   if last then do;
			   Start = ' ';
			   HLO = 'O';
			   Label = 'Not Found';&lt;BR /&gt;                           &lt;FONT color="#FF0000"&gt;output;&lt;/FONT&gt;
			   end;
 
 run;


 proc format cntlin=control_format fmtlib;
 run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 10:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374426#M24379</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-07-10T10:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: User defined formats</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374428#M24377</link>
      <description>&lt;P&gt;You just need to control the output statement in the datastep (which is at the end by default):&lt;/P&gt;
&lt;PRE&gt;data control_format;
  set cuserv.abc_general (drop=quantity retail_price rename=(n_item_name=start)) end=last;
  retain fmtname '$mdclass' type 'C';
  if last then do;
    output;
    start=' ';
    hlo='o';
    label='not found';
    output;
  end;
  else output;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 10:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/User-defined-formats/m-p/374428#M24377</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-10T10:32:12Z</dc:date>
    </item>
  </channel>
</rss>

