SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
ilmare
Calcite | Level 5

I formated 8 byte character string into Date(CCYYMMDD) by using INPUT.

I now want to use this Date in Filter to say Date>19990613, so that I can only pick the records that have Date greater than June 13, 1999.

I know there are such records that meet this criteria but when I run the project with this filter, I am getting 0 record back.

What am I doing wrong?

Thank you!!

5 REPLIES 5
Haikuo
Onyx | Level 15

Hi,

When SAS does the comparison on date, it compares the true numeric value instead of formated value:

data _null_;

a=input('19990613',anydtdte.);

put a= a=date9.;

run;

So you can see, if you do: date>14408, then see what happens.

Haikuo

FloydNevseta
Pyrite | Level 9

...or date>'13jun1999'd

ilmare
Calcite | Level 5

Haikuo:

Thank you for your advie.

As I am not familiar to the SAS coding, where can I go to find out the numeric value of 14408 in SEG? BTW, I used 14408 and it ran successfully with the date greater than Jun 13, 1999.

SAS_Bigot:

Thank you also for your advice.

I tried to use your expression on the Query Builder/Filter but it gave me an error. I must have done incorrectly.


Haikuo
Onyx | Level 15

Sorry. My EG experience is close to '0'. There are many with EG skills on the forum, your question will be answered sufficiently.

Haikuo

ilmare
Calcite | Level 5

Thank you, HaiKuo,

I was able to compute the Date by using Input w. anydtdte as you suggested, to come up with the numeric values in EG.

I appreciate your help.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 5 replies
  • 11911 views
  • 0 likes
  • 3 in conversation