BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Q1983
Lapis Lazuli | Level 10

data test;

borrower_dob = 25AUG1947:00:00:00.000000;

BORROWER_DOB1 = BORROWER_DOB;
format BORROWER_DOB1 yyyymmdd10.;

run;

I get the results truncated with a bunch of ........... in the field

Desired result is 19470825

 

1 ACCEPTED SOLUTION
2 REPLIES 2
tom_grant
SAS Super FREQ

data test;

borrower_dob = '25AUG1947:00:00:00.000000'dt;

BORROWER_DOB1 = datepart(BORROWER_DOB);
format BORROWER_DOB1 yymmdd10.;

run;

 

You have to tell SAS it is a datetime value (in-close in quotes & add dt) then use datepart function to pull out the date.  The correct format is yymmdd10.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1061 views
  • 1 like
  • 2 in conversation