<?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: How Do Use OTHER in numeric field with CNTLIN in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487118#M126875</link>
    <description>&lt;P&gt;Without actual data from the file you are reading it is hard to tell what exactly may be needed.&lt;/P&gt;
&lt;P&gt;You might be able to paste the csv into code box opened using the forum's {I} icon.&lt;/P&gt;
&lt;P&gt;As a minimum on the rows of your input data with the "other" value you need to have the HLO variable with the&amp;nbsp;value "O".&lt;/P&gt;
&lt;P&gt;It isn't that hard. Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data need;
   set formats;
   if start='OTHER' then do;
      start='**OTHER**';
      end  ='**OTHER**';
      HLO='O';
   end;
run;&lt;/PRE&gt;
&lt;P&gt;And use that for the cntlin data set. If you have other types of formats such as multilabel then you'll need to make HLO a wider variable to hold more information. You may also want a TYPE variable to indicate N for numeric of C for character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or if practical go back to whover supplied that CSV and see if they could make a cntlout data set for you (possibly in a transport data file for cross system use).&lt;/P&gt;</description>
    <pubDate>Wed, 15 Aug 2018 18:32:48 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-08-15T18:32:48Z</dc:date>
    <item>
      <title>How Do Use OTHER in numeric field with CNTLIN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487046#M126829</link>
      <description>&lt;P&gt;I am importing an excel file.&amp;nbsp; The start and end is numeric.&amp;nbsp; When I try to import the character "OTHER" SAS can't digest it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile='/folders/myfolders/Informat Test.csv' out=Formats&lt;BR /&gt;&amp;nbsp;replace dbms=csv; run;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Proc format Cntlin=formats;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get an import unsuccessful :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class="sasNote"&gt;NOTE: The infile '/folders/myfolders/Informat Test.csv' is:&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Filename=/folders/myfolders/Informat Test.csv,&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Owner Name=root,Group Name=vboxsf,&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Access Permission=-rwxrwx---,&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Last Modified=15Aug2018:11:04:31,&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;File Size (bytes)=1583&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for Start in line 55 18-22.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for End in line 55 24-28.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for Label in line 55 30-31.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;55 f1956DiscountTbl,OTHER,OTHER,NA 31&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;FMTName=f1956DiscountTbl Start=. End=. Label=. _ERROR_=1 _N_=54&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: 54 records were read from the infile '/folders/myfolders/Informat Test.csv'.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The minimum record length was 25.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The maximum record length was 31.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.FORMATS has 54 observations and 4 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.02 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Errors detected in submitted DATA step. Examine log.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;54 rows created in WORK.FORMATS from /folders/myfolders/Informat Test.csv.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;I am trying to approximate :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;value fmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 = "70"&lt;/P&gt;&lt;P&gt;2 = "80"&lt;/P&gt;&lt;P&gt;other = "NA";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487046#M126829</guid>
      <dc:creator>BrentonCSmith</dc:creator>
      <dc:date>2018-08-15T15:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: How Do Use OTHER in numeric field with CNTLIN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487051#M126831</link>
      <description>&lt;P&gt;As a learning exercise I might suggest creating an CNTLOUT data set from your example format and examining the result.&lt;/P&gt;
&lt;PRE&gt;Proc format library=work cntlout=work.fmts;
value fmt
1 = "70"
2 = "80"
other = "NA"
;
Run;&lt;/PRE&gt;
&lt;P&gt;While the start and label value appear in the format the real key is the HLO variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487051#M126831</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-15T15:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: How Do Use OTHER in numeric field with CNTLIN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487093#M126856</link>
      <description>&lt;P&gt;I did that without much success.&amp;nbsp; I think I need to define start and end as a $ value, and add the other later.&amp;nbsp; It is really just a nice to have that is creating a not nice headache.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 17:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487093#M126856</guid>
      <dc:creator>BrentonCSmith</dc:creator>
      <dc:date>2018-08-15T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How Do Use OTHER in numeric field with CNTLIN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487118#M126875</link>
      <description>&lt;P&gt;Without actual data from the file you are reading it is hard to tell what exactly may be needed.&lt;/P&gt;
&lt;P&gt;You might be able to paste the csv into code box opened using the forum's {I} icon.&lt;/P&gt;
&lt;P&gt;As a minimum on the rows of your input data with the "other" value you need to have the HLO variable with the&amp;nbsp;value "O".&lt;/P&gt;
&lt;P&gt;It isn't that hard. Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data need;
   set formats;
   if start='OTHER' then do;
      start='**OTHER**';
      end  ='**OTHER**';
      HLO='O';
   end;
run;&lt;/PRE&gt;
&lt;P&gt;And use that for the cntlin data set. If you have other types of formats such as multilabel then you'll need to make HLO a wider variable to hold more information. You may also want a TYPE variable to indicate N for numeric of C for character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or if practical go back to whover supplied that CSV and see if they could make a cntlout data set for you (possibly in a transport data file for cross system use).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487118#M126875</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-15T18:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: How Do Use OTHER in numeric field with CNTLIN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487195#M126920</link>
      <description>&lt;P&gt;Thanks, The HLO is the key variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried that earlier. Part of the problem was that the import process set the start and end values to numeric.&amp;nbsp; I had to add a 2nd record to the excel file that would get the start and end variables to $.&amp;nbsp; That explains the NOT EQ coding.&amp;nbsp; It looks kind of Klugey.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile='/folders/myfolders/Informat Test.csv' out=Formats&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace dbms=csv;&lt;BR /&gt;&amp;nbsp;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Data ConvertToChar;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length label $ 32;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Formats(where=(start NOT EQ "x")) end=EOF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type = "N";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HLO&amp;nbsp; = " ";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF EOF then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start = "**OTHER**";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&amp;nbsp;&amp;nbsp; = "**OTHER**";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL = "N/A";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HLO = "O";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;run;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Proc format Cntlin=ConvertToChar;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 20:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487195#M126920</guid>
      <dc:creator>BrentonCSmith</dc:creator>
      <dc:date>2018-08-15T20:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: How Do Use OTHER in numeric field with CNTLIN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487199#M126921</link>
      <description>&lt;P&gt;The "problem" was in the Proc Import.&amp;nbsp; The start and end values were read in as numeric.&amp;nbsp; I ended up adding a 2nd row to the excel table with X's in each variable.&amp;nbsp; It works but looks klugey as heck.&amp;nbsp; But your direction on the HLO variable was what moved me forward...&amp;nbsp; Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile='/folders/myfolders/Informat Test.csv' out=Formats&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace dbms=csv;&lt;BR /&gt;&amp;nbsp;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Data ConvertToChar;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length label $ 32;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Formats(where=(start NOT EQ "x")) end=EOF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type = "N";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HLO&amp;nbsp; = " ";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF EOF then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start = "**OTHER**";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&amp;nbsp;&amp;nbsp; = "**OTHER**";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL = "N/A";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HLO = "O";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;run;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Proc format Cntlin=ConvertToChar;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 20:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-Use-OTHER-in-numeric-field-with-CNTLIN/m-p/487199#M126921</guid>
      <dc:creator>BrentonCSmith</dc:creator>
      <dc:date>2018-08-15T20:48:04Z</dc:date>
    </item>
  </channel>
</rss>

