DATA Step, Macro, Functions and more

'00'x exists in input ASCII file, can I ignore?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

'00'x exists in input ASCII file, can I ignore?

A client sent me an ASCII flat text file that looks fine in NOTEPAD and Excel will import w/o issue, but when I read it in SAS using "input" everything blows up because SAS sees '00'X as every other character. Is there an input option to accomodate this?

Example of SAS LOG:

NOTE: Invalid data for costcenterid in line 2 37-39.

NOTE: Invalid data for accountid in line 2 100-113.

NOTE: Invalid data for amount in line 2 193-193.

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+---

2   CHAR  .2.0.1.1.-.1.0.-.0.1. .0.0.:.0.0.:.0.0. . . . . .O.c.t. .1.1. .A.c.t. . . .1.2.3.4.5. .

    ZONE  0303030302030302030302030303030303030302020202020406070203030204060702020203030303030202

    NUMR  020001010D01000D00010000000A00000A000000000000000F03040001010001030400000001020304050000

      89  . . . . . .A.l.l.e.g.r.a. .W.r.i.t.e.-.o.f.f. . . . . . . . . . . . . . . . . . . . . .

    ZONE  0202020202040606060607060205070607060206060602020202020202020202020202020202020202020202

    NUMR  0000000000010C0C050702010007020904050D0F060600000000000000000000000000000000000000000000

     177  . . . . . . . . . . . . .6.7.8.9.9.9. . . . . . . . . . . . . . . . . . . . . . . . . .

    ZONE  0202020202020202020202020303030303030202020202020202020202020202020202020202020202020202

    NUMR  0000000000000000000000000607080909090000000000000000000000000000000000000000000000000000

     265  . . . . . . . . .A.L.L.E.G.R.A. .W.R.I.T.E. .O.F.F. . . . . . . . . . . . . . . . . . .

    ZONE  0202020202020202040404040405040205050405040204040402020202020202020202020202020202020202

    NUMR  0000000000000000010C0C05070201000702090405000F060600000000000000000000000000000000000000

     353  . . . . . .E.x.p.e.n.s.e. . . . .0...0.0.0.0...

    ZONE  0202020202040707060607060202020203020303030300022222222222222222222222222222222222222222

    NUMR  0000000000050800050E030500000000000E000000000D000000000000000000000000000000000000000000

     441

This is the data pasted from NOTEPAD:

2011-10-01 00:00:00     Oct 11 Act   12345       Allegra Write-off                                  678999                                  ALLEGRA WRITE OFF                        Expense    0.0000


Accepted Solutions
Solution
‎11-07-2012 08:49 PM
PROC Star
Posts: 7,487

Re: '00'x exists in input ASCII file, can I ignore?

Try including this option: encoding=unicode

View solution in original post


All Replies
Solution
‎11-07-2012 08:49 PM
PROC Star
Posts: 7,487

Re: '00'x exists in input ASCII file, can I ignore?

Try including this option: encoding=unicode

Occasional Contributor
Posts: 11

Re: '00'x exists in input ASCII file, can I ignore?

dmorrell!

Try change _infile_.

verify sintaxe the _infile_ and prxchange()

ok

my english is tiny....

thank

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 294 views
  • 0 likes
  • 3 in conversation