Rohit
Rohit

Reputation: 5

SAS Input statement skipping a column reading from CSV file

data liquidity;
  infile '/home/loeeqsas/83.csv' dlm = ',' termstr=crlf dsd;
  input qid ddate date9. price vol af;
  adjprice=price*af;
  srtn=adjprice/lag1(adjprice)-1;
  dvol=adjprice*vol;

proc print data = liquidity;
run;

Output puts the price data in the vol column and shows price as blank. Is this to do with the date format? Thank you.

Upvotes: 0

Views: 582

Answers (1)

Joe
Joe

Reputation: 63424

This line is wrong:

input qid ddate date9. price vol af;

You can't put the informat that way without a colon. Otherwise it will read incorrectly. Either move it to an INFORMAT statement, or add a colon:

input qid ddate :date9. price vol af;

Upvotes: 1

Related Questions