Help using Base SAS procedures

Convert Char Var Date9 format to SASDATE for comparison.

Reply
Occasional Contributor
Posts: 5

Convert Char Var Date9 format to SASDATE for comparison.

I am trying to convert a Character date DDMonYYY format to a SASDATE to compare against a Raw date read in as ccyymmdd and converted to SASDATE. I tried using INPUT function as in Sample 24591 using Date9, but it does not work. I get "Invalid argument to INPUT function at Line ### Column ##'. When I PUT the string data into the SASLOG it shows that it matches. The new data field using the INPUT function dusplays as missing.

Respected Advisor
Posts: 4,934

Re: Convert Char Var Date9 format to SASDATE for comparison.

Is this the problem : reading a date with a 3-digit year?

PG
Occasional Contributor
Posts: 5

Re: Convert Char Var Date9 format to SASDATE for comparison.

No, that was a typo. The date read in is format is DDMonYYYY.

Super User
Posts: 11,343

Re: Convert Char Var Date9 format to SASDATE for comparison.

It would help to show the code actually used. I would say the most likely culprit are some specific values are not valid dates: 30FEB2014 for instance.

Show an entire error message.

Ask a Question
Discussion stats
  • 3 replies
  • 221 views
  • 0 likes
  • 3 in conversation