BookmarkSubscribeRSS Feed
sasuser8675309
Calcite | Level 5

Hello--

I have a simple input statement that I am using to test a program.  It works fine in SAS 9.3 and EG 5.1 on my personal machine.  However, when I try this on my work computer, which uses EG 6.1 through the SASApp Server, it has issues.  The syntax is fine, so I cannot understand what the issue is.

data example;

  input productgroup $ state $ id amount price;

cards;

lumber  NC 17442 21324 66.83

lumber  NC 17951 353726 19.40

;

run;

Any help would be greatly appreciated, since this seems to be a simple issue and it's driving me crazy.

Nick

ps.  I can "force" it to work with length statements, but I shouldn't have to.  Also, not practical since I will sometimes be testing this with larger datasets.\

4 REPLIES 4
sasuser8675309
Calcite | Level 5

I can also force it to work by altering the statement to

data example;

  infile cards delimiter=',';

  input productgroup $ state $ id amount price;

cards;

lumber,NC,17442,21324,66.83

lumber,NC,17951,353726,19.40

;

run;

This seems unnecessary, since the original syntax was correct....am I missing something here?  I'm losing my mind....

Tom
Super User Tom
Super User

What is the error message?

sasuser8675309
Calcite | Level 5

Weird....

I tried the old "turn it off and turn it back on" trick and now it's working.  Maybe the server had stored a stale image of the data set somehow?  Either way, thanks for response.

Ksharp
Super User

Maybe your work computer mistake blank delimiter as TAB delimiter , just guess.

data example;

infile cards  expandtabs ;

input productgroup $ state $ id amount price;

cards;

lumber  NC 17442 21324 66.83

lumber  NC 17951 353726 19.40

;

run;

Xia Keshan

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1165 views
  • 0 likes
  • 3 in conversation