<?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: Infile data txt with delimiter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684001#M207224</link>
    <description>&lt;P&gt;See this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile REFFILE
  delimiter = ';'
  dsd /* this option causes two delimiters being read as a missing value */
  truncover
  lrecl=32767
  firstobs=2
;
input
  CODAAEST :$7. /* read codes as character */
  CODMMEST :$2.
  CODEMPRE :$2.
  CODOPERA :$char12.
  temp1
  temp2
  CODIGIF :$char10.
  FECFORMO :yymmdd10.
  FECVECI :yymmdd10.
;
format
  FECFORMO yymmdd10.
  FECVECI yymmdd10.
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;add other variables in the same manner as required.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2020 16:47:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-09-15T16:47:27Z</dc:date>
    <item>
      <title>Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/683981#M207210</link>
      <description>&lt;P&gt;It's trial and error to get the import acting like expected.&lt;/P&gt;
&lt;P&gt;I use truncover, missover and dsd like it was a lotery ticket. But it's because it never does what I want it to do.&lt;/P&gt;
&lt;P&gt;When I explicitly declare ";" as a delimiter, why the execution does not interpret them in that way?&lt;/P&gt;
&lt;P&gt;Why it ignores blank columns instead of writing missing to the corresponding columns?&lt;/P&gt;
&lt;P&gt;Why yymmdd10. does not work for the date columns?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log says:&lt;/P&gt;
&lt;DIV id="sasLogWarning2_1600180201827" class="sasWarning"&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&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;21 2011;01;03;XXXXXXXXXXXX; ; ;XXXXXXXX ;2004-12-21;2006-09-14&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;101 ;R; ;N;&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE id="pre_sasLog_202" class="sasLog" style="background-color: transparent; -webkit-user-select: text; -webkit-user-modify: read-only; -webkit-touch-callout: default; border-top-width: 0px; border-bottom-width: 0px;"&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE '/caslibs/risknb/IFRS9_CONTRATOS_202008.TXT' encoding=wlatin1;     


data public.test    ;
        %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
        infile REFFILE delimiter = ';' truncover MISSOVER  lrecl=32767 firstobs=2 n=1000;
input CODAAEST CODMMEST CODEMPRE CODOPERA $char12. temp1 temp2  CODIGIF $char10. FECFORMO $CHAR10.  FECVECI $CHAR20. 
TIPOCLIE $32. RATICLI  8 XEMPLEAD $32. CODPRODU $32. ESTVEHIC $32. PCTIEFEC  8 PCTOMI  8 IMPCAPE  8 
IMPSALVE  8 FECMATRI $32. FECREVEH $32. IMPVRESI  8 FECPRIAC $32. XIDPOCI $32. XIDFALL $32. XDEFAULT $32.
XIDSUBJ $32. FECDEFAU $32. IMPPDDEF  8 IMPVCDEF  8 XISTAGE  8 IMPDOTAC  8 QDIAATI  8 QDIASMAD  8 
QMESESDF  8 PCTPD  8 PCTLGD  8 REMTBOOK  8 TIMEHORI  8 QAAPDTDF  8 IMPEXPDF  8 IMPDOTCU  8 IMPDOTDU
  8 IMPDOTVR  8 FECDATOS $32. USOFUTUR  8 CODSEGPD  8 CODSELGD  8 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="for.png" style="width: 728px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49382iDF3462A73F518B01/image-size/large?v=v2&amp;amp;px=999" role="button" title="for.png" alt="for.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 15:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/683981#M207210</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2020-09-15T15:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/683984#M207213</link>
      <description>&lt;P&gt;When you have informats as part of the input statement the way you have those then the number of characters in the informat is read. Period. Which means some of the delimiters end up in the data when the actual values are shorter or missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try adding a : in front of all the $ formats.&lt;/P&gt;
&lt;P&gt;Or have a separate INFORMAT statement with the character variables and remove the informats from the INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there some specific reason you want the date values to be character? Any manipulation of the dates will require creating a date value. You could likely save yourself some headaches later by reading the dates with yymmdd10. informat and then assign any desired format so people understand them.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 15:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/683984#M207213</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-15T15:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/683995#M207221</link>
      <description>&lt;P&gt;Thank you ballardw.&lt;/P&gt;
&lt;P&gt;But it's getting only slightly better, the proceeding : before the char format helps.&lt;/P&gt;
&lt;P&gt;But when I try to define the informat everything turns chaotic again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here are the last 2 versions.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data public.test    ;
        %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
        infile REFFILE delimiter = ';' truncover dsd  lrecl=32767 firstobs=2 n=1000;
input CODAAEST CODMMEST CODEMPRE CODOPERA :$char12. temp1 temp2  CODIGIF :$char10. FECFORMO  FECVECI 
TIPOCLIE :$32. RATICLI 12 XEMPLEAD :$32. CODPRODU :$32. ESTVEHIC :$32. PCTIEFEC  12 PCTOMI 12 IMPCAPE  12 
IMPSALVE  12 FECMATRI :$32. FECREVEH :$32. IMPVRESI  12 FECPRIAC :$32. XIDPOCI :$32. XIDFALL :$32. XDEFAULT :$32.
XIDSUBJ :$32. FECDEFAU :$32. IMPPDDEF  12 IMPVCDEF  12 XISTAGE  12 IMPDOTAC  12 QDIAATI  12 QDIASMAD  12 
QMESESDF  12 PCTPD  12 PCTLGD  12 REMTBOOK  12 TIMEHORI  12 QAAPDTDF  12 IMPEXPDF  12 IMPDOTCU  12 IMPDOTDU
  12 IMPDOTVR  12 FECDATOS  USOFUTUR  12 CODSEGPD  12 CODSELGD  12 ;
informat FECFORMO FECVECI fecdatos yymmdd10.;
run;

data public.test    ;
        %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
        infile REFFILE delimiter = ';' truncover dsd  lrecl=32767 firstobs=2 n=1000;
input CODAAEST CODAAEST CODMMEST CODEMPRE CODOPERA temp1 temp2 CODIGIF FECFORMO FECVECI TIPOCLIE RATICLI XEMPLEAD CODPRODU ESTVEHIC PCTIEFEC 
PCTOMI IMPCAPE IMPSALVE FECMATRI FECREVEH IMPVRESI FECPRIAC XIDPOCI XIDFALL XDEFAULT XIDSUBJ FECDEFAU IMPPDDEF IMPVCDEF XISTAGE 
IMPDOTAC QDIAATI QDIASMAD QMESESDF PCTPD PCTLGD REMTBOOK TIMEHORI QAAPDTDF IMPEXPDF IMPDOTCU IMPDOTDU IMPDOTVR FECDATOS USOFUTUR 
CODSEGPD CODSELGD;
informat CODOPERA $12. CODIGIF $10.  XIDPOCI XIDFALL XDEFAULT XIDSUBJ $1.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/683995#M207221</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2020-09-15T16:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684001#M207224</link>
      <description>&lt;P&gt;See this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile REFFILE
  delimiter = ';'
  dsd /* this option causes two delimiters being read as a missing value */
  truncover
  lrecl=32767
  firstobs=2
;
input
  CODAAEST :$7. /* read codes as character */
  CODMMEST :$2.
  CODEMPRE :$2.
  CODOPERA :$char12.
  temp1
  temp2
  CODIGIF :$char10.
  FECFORMO :yymmdd10.
  FECVECI :yymmdd10.
;
format
  FECFORMO yymmdd10.
  FECVECI yymmdd10.
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;add other variables in the same manner as required.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684001#M207224</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-15T16:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684002#M207225</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127222"&gt;@acordes&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you ballardw.&lt;/P&gt;
&lt;P&gt;But it's getting only slightly better, the proceeding : before the char format helps.&lt;/P&gt;
&lt;P&gt;But when I try to define the informat everything turns chaotic again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here are the last 2 versions.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data public.test    ;
        %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
        infile REFFILE delimiter = ';' truncover dsd  lrecl=32767 firstobs=2 n=1000;
input CODAAEST CODMMEST CODEMPRE CODOPERA :$char12. temp1 temp2  CODIGIF :$char10. FECFORMO  FECVECI 
TIPOCLIE :$32. RATICLI 12 XEMPLEAD :$32. CODPRODU :$32. ESTVEHIC :$32. PCTIEFEC  12 PCTOMI 12 IMPCAPE  12 
IMPSALVE  12 FECMATRI :$32. FECREVEH :$32. IMPVRESI  12 FECPRIAC :$32. XIDPOCI :$32. XIDFALL :$32. XDEFAULT :$32.
XIDSUBJ :$32. FECDEFAU :$32. IMPPDDEF  12 IMPVCDEF  12 XISTAGE  12 IMPDOTAC  12 QDIAATI  12 QDIASMAD  12 
QMESESDF  12 PCTPD  12 PCTLGD  12 REMTBOOK  12 TIMEHORI  12 QAAPDTDF  12 IMPEXPDF  12 IMPDOTCU  12 IMPDOTDU
  12 IMPDOTVR  12 FECDATOS  USOFUTUR  12 CODSEGPD  12 CODSELGD  12 ;
informat FECFORMO FECVECI fecdatos yymmdd10.;
run;

data public.test    ;
        %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
        infile REFFILE delimiter = ';' truncover dsd  lrecl=32767 firstobs=2 n=1000;
input CODAAEST CODAAEST CODMMEST CODEMPRE CODOPERA temp1 temp2 CODIGIF FECFORMO FECVECI TIPOCLIE RATICLI XEMPLEAD CODPRODU ESTVEHIC PCTIEFEC 
PCTOMI IMPCAPE IMPSALVE FECMATRI FECREVEH IMPVRESI FECPRIAC XIDPOCI XIDFALL XDEFAULT XIDSUBJ FECDEFAU IMPPDDEF IMPVCDEF XISTAGE 
IMPDOTAC QDIAATI QDIASMAD QMESESDF PCTPD PCTLGD REMTBOOK TIMEHORI QAAPDTDF IMPEXPDF IMPDOTCU IMPDOTDU IMPDOTVR FECDATOS USOFUTUR 
CODSEGPD CODSELGD;
informat CODOPERA $12. CODIGIF $10.  XIDPOCI XIDFALL XDEFAULT XIDSUBJ $1.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try placing the INFORMAT prior to the Input statement. Your second data step is missing a lot of variables from the first one, many of the character variables. So if these are supposed to read the same file then you are reading columns into the wrong variables.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684002#M207225</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-15T16:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684011#M207228</link>
      <description>&lt;P&gt;nearly...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;works fine with this code, but commax format does not behave well for the second variable, the first is applied correctly.&lt;/P&gt;
&lt;P&gt;and the informat for the date does nothing.&lt;/P&gt;
&lt;P&gt;later I'll try your approach&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data public.test    ;
        %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
        infile REFFILE delimiter = ';'  lrecl=32767 firstobs=2 n=1000;
input CODAAEST CODMMEST CODEMPRE CODOPERA :$char12. temp1 temp2  CODIGIF :$char10. FECFORMO  FECVECI 
TIPOCLIE :$1. RATICLI XEMPLEAD :$1. CODPRODU :$2. ESTVEHIC :$1. PCTIEFEC commax8.5  PCTOMI commax8.5   IMPCAPE  
IMPSALVE FECMATRI  FECREVEH  IMPVRESI  FECPRIAC  XIDPOCI :$1. XIDFALL :$1. XDEFAULT :$1.
XIDSUBJ :$1. FECDEFAU  IMPPDDEF  IMPVCDEF  XISTAGE   IMPDOTAC  QDIAATI   QDIASMAD  
QMESESDF PCTPD  PCTLGD  REMTBOOK  TIMEHORI  QAAPDTDF  IMPEXPDF  IMPDOTCU IMPDOTDU
IMPDOTVR  FECDATOS  USOFUTUR  CODSEGPD   CODSELGD   ;
informat FECFORMO FECVECI  FECMATRI FECREVEH FECPRIAC FECDEFAU fecdatos yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="for2.png" style="width: 912px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49383i5858C0B456CC75B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="for2.png" alt="for2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 17:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684011#M207228</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2020-09-15T17:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684020#M207232</link>
      <description>&lt;P&gt;I gave you an example for nicely structured, easily readable code. Please stop writing such ugly spaghetti code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't use fractions in informats when commas are present to mark the decimal dot. Your informat will override the comma in the data.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 18:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684020#M207232</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-15T18:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684027#M207236</link>
      <description>&lt;P&gt;Okay.&lt;/P&gt;
&lt;P&gt;But the problem remains even with your nicely structured code.&lt;/P&gt;
&lt;P&gt;What format or informat reads correctly those variables where I wrongly apply the commax format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 18:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684027#M207236</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2020-09-15T18:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684036#M207242</link>
      <description>&lt;P&gt;Try running next code, derived from yours with next changes:&lt;/P&gt;
&lt;P&gt;1) omit all informat length, just assign $ for char=type variables;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; one exception for dates to be read with :yymmdd10. informat;&lt;/P&gt;
&lt;P&gt;2) Add a LENGTH statement to assign the max length of char=type variables;&lt;/P&gt;
&lt;P&gt;3) %let is a declarative statement and not a datastep statemnt.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;better move it before the datastep.&lt;/P&gt;
&lt;P&gt;4) add a FORMAT statement to dates;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE '/caslibs/risknb/IFRS9_CONTRATOS_202008.TXT' encoding=wlatin1;     

%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
data public.test    ;
 LENGTH &amp;lt;all char-type variables and their max length&amp;gt; ;
 INFILE REFFILE delimiter = ';' truncover MISSOVER  lrecl=32767 firstobs=2 n=1000;
 INPUT CODAAEST CODMMEST CODEMPRE CODOPERA $ temp1 temp2  CODIGIF $ FECFORMO $
   FECVECI TIPOCLIE $ RATICLI  XEMPLEAD $ CODPRODU $ ESTVEHIC $ PCTIEFEC   PCTOMI 
   IMPCAPE IMPSALVE  FECMATRI $ FECREVEH $ IMPVRESI  FECPRIAC $ XIDPOCI $ XIDFALL $
   XDEFAULT $ XIDSUBJ $ FECDEFAU $ IMPPDDEF  IMPVCDEF  XISTAGE  IMPDOTAC  QDIAATI  
   QDIASMAD QMESESDF  PCTPD  PCTLGD  REMTBOOK TIMEHORI QAAPDTDF  MPEXPDF  IMPDOTCU 
   IMPDOTDU IMPDOTVR  FECDATOS $ USOFUTUR  CODSEGPD  CODSELGD  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 19:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684036#M207242</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-09-15T19:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684038#M207244</link>
      <description>&lt;P&gt;Let's focus on this part of the INPUT statement, where you are still not satisfied with the results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PCTIEFEC commax8.5  PCTOMI commax8.5 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As was mentioned, you don't need to be using commax8.5.&amp;nbsp; Let the raw data indicate where the decimal point should go.&amp;nbsp; So the first change would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PCTIEFEC commax8.  PCTOMI commax8. &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Next, I would assume you are happy with the value assigned to PCTIEFEC, but need to fix the value assigned to PCTOMI.&amp;nbsp; To do that, recognize that the problem is that the first character read for PCTOMI is the semicolon between the variables.&amp;nbsp; That won't be properly interpreted (generating your log message about invalid data for PCTOMI), unless you add a colon.&amp;nbsp; Do it for both variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PCTIEFEC : commax8.  PCTOMI : commax8.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That change should take care of those two variables, and would give you a roadmap to follow if others are causing trouble.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 19:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684038#M207244</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-09-15T19:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684058#M207254</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127222"&gt;@acordes&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Okay.&lt;/P&gt;
&lt;P&gt;But the problem remains even with your nicely structured code.&lt;/P&gt;
&lt;P&gt;What format or informat reads correctly those variables where I wrongly apply the commax format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Would you please take the time and read my post in its entirety? I already gave you the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 20:07:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684058#M207254</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-15T20:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684063#M207257</link>
      <description>&lt;P&gt;Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; for the hint with the : and the informat.&lt;/P&gt;
&lt;P&gt;Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; for the commax explanation.&lt;/P&gt;
&lt;P&gt;Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt; for the final tips &amp;amp; tricks that let me approach the final solution.&lt;/P&gt;
&lt;P&gt;and thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; for his patience and for the incentive he gives me to keep learning more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The final code is as follows, like an ensemble.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE '/caslibs/risknb/IFRS9_CONTRATOS_202008.TXT' encoding=wlatin1;     

%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
data public.test    ;
LENGTH CODOPERA $12 CODIGIF $10 XEMPLEAD $1 CODPRODU $2 ESTVEHIC $1 XIDPOCI $1 XIDFALL $1 XDEFAULT $1
XIDSUBJ $1;

informat FECFORMO FECVECI FECMATRI FECREVEH FECPRIAC FECDEFAU fecdatos yymmdd10. ;
format FECFORMO FECVECI FECMATRI FECREVEH FECPRIAC FECDEFAU fecdatos date9. PCTIEFEC PCTOMI PCTPD PCTLGD percent9.2;

INFILE REFFILE delimiter = ';' truncover MISSOVER  lrecl=32767 firstobs=2 n=1000;
INPUT CODAAEST CODMMEST CODEMPRE CODOPERA $ temp1 temp2  CODIGIF $ FECFORMO $
   FECVECI TIPOCLIE $ RATICLI  XEMPLEAD $ CODPRODU $ ESTVEHIC $ PCTIEFEC : commax8.  PCTOMI : commax8. 
   IMPCAPE IMPSALVE  FECMATRI $ FECREVEH $ IMPVRESI  FECPRIAC $ XIDPOCI $ XIDFALL $
   XDEFAULT $ XIDSUBJ $ FECDEFAU $ IMPPDDEF  IMPVCDEF  XISTAGE  IMPDOTAC  QDIAATI  
   QDIASMAD QMESESDF  PCTPD : commax8.   PCTLGD : commax8.  REMTBOOK TIMEHORI QAAPDTDF  MPEXPDF  IMPDOTCU 
   IMPDOTDU IMPDOTVR  FECDATOS $ USOFUTUR  CODSEGPD  CODSELGD  ;

array div100(4) PCTIEFEC PCTOMI PCTPD PCTLGD;

do i=1 to dim(div100);
div100(i)=div100(i)/100;
end;

drop temp: i;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Sep 2020 20:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684063#M207257</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2020-09-15T20:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684069#M207262</link>
      <description>&lt;P&gt;It looks a lot like you have mixed up the syntax of the LENGTH statement and the INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this a LENGTH statement then just want to use $nnn for the character variables. No need for the period, lengths are always integer values and are not format specifications.&amp;nbsp; So you cannot use an informat like $CHAR in a LENGTH statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is an INPUT statement you do not want to read all of those numeric variables as the single digit in column 8.&amp;nbsp; You should just remove the 8 and not have an informat for those variables.&amp;nbsp; And for the variables where you do want to include an informat specification you want to add the colon modifier in front to prevent the informat from reading past the delimiters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is much clearer and easier if you first define the variables with a LENGTH statement. Then the INPUT statement just needs to list the variables. So you are not forcing the INPUT statement to do double duty.&amp;nbsp; &amp;nbsp;If any of the variables &lt;STRONG&gt;need&lt;/STRONG&gt; to be read with a special informat (and most numbers or character strings do NOT need special input instructions) then add an INFORMAT statement. If any of the variables &lt;STRONG&gt;need&lt;/STRONG&gt; special instructions for how to display them (and most numbers and character strings do NOT need special output instructions) then add a FORMAT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So perhaps your data step will look something like this.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data public.test ;
  infile refile dsd dlm= ';' truncover firstobs=2 ;
  length CODAAEST CODMMEST CODEMPRE 8
         CODOPERA $12 
         temp1 temp2 CODIGIF FECFORMO $10  
         FECVECI $20 TIPOCLIE $32 RATICLI 8 
         XEMPLEAD CODPRODU ESTVEHIC $32 
         PCTIEFEC PCTOMI IMPCAPE IMPSALVE 8
         FECMATRI FECREVEH $32 
         IMPVRESI 8 
         FECPRIAC XIDPOCI XIDFALL XDEFAULT XIDSUBJ FECDEFAU $32 
         IMPPDDEF IMPVCDEF  XISTAGE IMPDOTAC QDIAATI QDIASMAD  8 
         QMESESDF PCTPD PCTLGD REMTBOOK TIMEHORI QAAPDTDF IMPEXPDF  8
         IMPDOTCU IMPDOTDU IMPDOTVR  8 
         FECDATOS $32 
         USOFUTUR CODSEGPD CODSELGD  8 
  ;
  input CODAAEST -- CODSELGD ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 00:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684069#M207262</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-16T00:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Infile data txt with delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684138#M207291</link>
      <description>Tom, that's very didactic. Thank you</description>
      <pubDate>Wed, 16 Sep 2020 06:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-data-txt-with-delimiter/m-p/684138#M207291</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2020-09-16T06:54:13Z</dc:date>
    </item>
  </channel>
</rss>

