BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tmm
Fluorite | Level 6 tmm
Fluorite | Level 6

I have a table where the SAS dates for fst service and birthday are

      8    BIRTHDAY                Num       8    DATE9.    DATE9.      BIRTHDAY

I am trying to reformat in my proc sql as yyyymmdd

Here is my code and I am just drawing a complete blank

proc sql;*select distinct information;

create table sum0513 as

(select distinct

sys_id,

alt_id,

sub_nbr,

acct_nbr,

fst_srvc_dt format date=yymmdd8.,

first_name,

last_name,

bday format date=yymmdd8.,

age,

from tbl2

group by sys_id, fst_srvc_dt, acct_nbr);

run;

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

fst_srvc_dt format=yymmddN8.,


The syntax is FORMAT= and then the format. YYMMDD8 will get you two digit years and hyphens.  The N in code above means to not use any separator, so there is room for four digit years.  You could also use YYMMDD10. if you like the separators.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

fst_srvc_dt format=yymmddN8.,


The syntax is FORMAT= and then the format. YYMMDD8 will get you two digit years and hyphens.  The N in code above means to not use any separator, so there is room for four digit years.  You could also use YYMMDD10. if you like the separators.

tmm
Fluorite | Level 6 tmm
Fluorite | Level 6


Thanks. Brainfart day.

ballardw
Super User

I think what you're looking for is;

fst_srvc_dt format=yymmdd8.,

or in a datastep

format fst_srvc_dt yymmdd8.;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 688 views
  • 3 likes
  • 3 in conversation