SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASPhile
Quartz | Level 8

How to convert Julian date to YYYY-DD-MM

data t;

t=2013231;

t2=2013224;

  run;

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

I used the function datejul() which converts julian date to a sas date value and then used the format yymmdd10.  Need to check if there is format for yyddmm. Else we need to separate the month and day from the date and then concatenate them into yyddmm. if there is any other way , would like to know it

data t;

t=2013231;

t2=2013224;

t_=DATEJUL(t);

t2_=DATEJUL(t2);

format t_ t2_  yymmdd10.;

  run;

Thanks,

Jagadish

Thanks,
Jag

View solution in original post

2 REPLIES 2
Fugue
Quartz | Level 8

You can convert a Julian date to a SAS date value with the DATEJUL function.

data t;

format date1 date2 yymmdd10.;

t=2013231;

t2=2013224;

date1=datejul(t);

date2=dateful(t2);

;

run;

Jagadishkatam
Amethyst | Level 16

I used the function datejul() which converts julian date to a sas date value and then used the format yymmdd10.  Need to check if there is format for yyddmm. Else we need to separate the month and day from the date and then concatenate them into yyddmm. if there is any other way , would like to know it

data t;

t=2013231;

t2=2013224;

t_=DATEJUL(t);

t2_=DATEJUL(t2);

format t_ t2_  yymmdd10.;

  run;

Thanks,

Jagadish

Thanks,
Jag

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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