SAS DATE

Reply
Super Contributor
Posts: 1,041

SAS DATE

Hi Team,

I have dates like this in a big master dataset:

date

20141130

20141225

20131022

I wanted to pull all the dates from 2013april to 2014 march ...that is for one year

i do like below and i get 0 records pulled up!!!!!!

is there anything wrong i am doing???

%let bgndt = '01APR2013'D;

%let enddt = '31MAR2014'D;

data want;

set have;

where Date between &bgndt and &enddt;

run;

Super User
Posts: 19,820

Re: SAS DATE

Posted in reply to robertrao

Check the type of your variable date, is it numeric with a date format or a number or a character?

Super Contributor
Posts: 1,041

Re: SAS DATE

Its NUMERIC with Format 11.

Thanks

Super User
Posts: 19,820

Re: SAS DATE

Posted in reply to robertrao

So then its a number not a date so you SAS dates won't work with it.

Either convert to a date or change your boundaries to a number.

Because it is a number you can just use 20130401 and 20140331 as your boundaries. 

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