Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

SAS dates

SAS dates

SAS dates

Hello, i'm a SAS beginner and i have a question:

i'm trying to archive a part of my dataset

data _null_;
 format archive_date date9.;
 archive_date = date() - (30);
 put 'Archief_datum = ' archive_date;
 call symput('archive_date',left(put(archive_date,12.)));

data rf300l3.W_status_foup_count;
 set rf300l3.W_status_foup_count;
 if Date > &archive_date  then output rf300l3.W_status_foup_count;

yet, i get this error:

NOTE: Character values have been converted to numeric values at the places given by:
NOTE: Invalid numeric data, date='28OCT2010' , at line 1082 column 5.
dept=BIONE date=28OCT2010 code=HOLD CUST nbr=0 _ERROR_=1 _N_=1
NOTE: Invalid numeric data, date='28OCT2010' , at line 1082 column 5.

any help?


RE: SAS dates

What format is your "date" variable in rf300l3.w_status_foup_count??

RE: SAS dates

01JAN2009 for example

RE: SAS dates

But is it stored as a character field rather than a date field? Your error suggests that 01JAN2009 for example is a character field which it's then trying to change to a numeric to carry out the numeric date comparison on and it's causing an error. SAS dates work by linking a date to the number of days before and after 1st Jan 1960 (I think!) and therefore to check if something is before or after a certain date or number of days it needs to be reading it as a date fields rather than character.

If it's a character - try turning it to a date field first maybe? If not...we'll try something else!


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close