<?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: create format with cntlin= in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-format-with-cntlin/m-p/451556#M113872</link>
    <description>&lt;P&gt;Can you add an OTHER condition to mark those as blank or error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a PROC FORMAT it's&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;other = " "&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Using a CNTLIN data set you use the HLO column instead and set that to O (letter o).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cntrl; 
	retain fmtname stdcd factor;
	set rfdata; 
         by factor;


	length fmtname $10;
	fmtname=strip(Factor)||'CD';
        type='C';



	rename stdcd = start factor= label;

        output;
        if last.factor then do;
                hlo='O';
               label=' ';
               output;
              call missing(hlo, label);
        end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Apr 2018 15:12:59 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-04-05T15:12:59Z</dc:date>
    <item>
      <title>create format with cntlin=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-format-with-cntlin/m-p/451549#M113866</link>
      <description>&lt;P&gt;&amp;nbsp;I create several formats by one control file. The variable a is a valid code in RF369 group and fact1 contains label RF369 which is expected. However, b is an invalid code in the RF390 code group and fact2 contains 'M8888' which is unexpected. How can I get blank in fact2, or a blank label if the code is invalid in any group?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data rfdata;
	input factor $ 1-7  stdcd $8-14;
	cards;
	RF369  E680
	RF370  D780
	RF370  D781
	RF390  M66780
	RF390  M781219
	RF390  M123456
	RF390  M231
	;;
run;
data cntrl; 
	retain fmtname stdcd factor;
	set rfdata; 
	length fmtname $10;
	fmtname='$'||strip(Factor)||'CD';
	rename stdcd = start;
	rename factor= label;
	output;
run;

proc format library=work cntlin=cntrl; run;

data usefmt;
	length a b $7 fact1 fact2 $20;
	a="E680";
	b="M88888";
	fact1=put(a, $RF369CD.);
	fact2=put(b, $RF390CD.); 
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 15:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-format-with-cntlin/m-p/451549#M113866</guid>
      <dc:creator>nnl3256</dc:creator>
      <dc:date>2018-04-05T15:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: create format with cntlin=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-format-with-cntlin/m-p/451556#M113872</link>
      <description>&lt;P&gt;Can you add an OTHER condition to mark those as blank or error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a PROC FORMAT it's&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;other = " "&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Using a CNTLIN data set you use the HLO column instead and set that to O (letter o).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cntrl; 
	retain fmtname stdcd factor;
	set rfdata; 
         by factor;


	length fmtname $10;
	fmtname=strip(Factor)||'CD';
        type='C';



	rename stdcd = start factor= label;

        output;
        if last.factor then do;
                hlo='O';
               label=' ';
               output;
              call missing(hlo, label);
        end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Apr 2018 15:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-format-with-cntlin/m-p/451556#M113872</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-05T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: create format with cntlin=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-format-with-cntlin/m-p/451597#M113888</link>
      <description>&lt;P&gt;With little modification (in the last.factor group, use factor instead of label), it works fine.&amp;nbsp; Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 16:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-format-with-cntlin/m-p/451597#M113888</guid>
      <dc:creator>nnl3256</dc:creator>
      <dc:date>2018-04-05T16:00:28Z</dc:date>
    </item>
  </channel>
</rss>

