BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dmorrell
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Try including this option: encoding=unicode

View solution in original post

2 REPLIES 2
art297
Opal | Level 21

Try including this option: encoding=unicode

Geraldo
Fluorite | Level 6

dmorrell!

Try change _infile_.

verify sintaxe the _infile_ and prxchange()

ok

my english is tiny....

thank

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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