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

Possibly a version issue then as I am running on:

9.04.01M3P062415

OS: LIN X64

Ksharp
Super User

Did you see the difference part of my code with your code ?

 

low-high='%Y-%0m-%0d %0H:%0M:%0S '

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Probably not ideal, but I always have numeric and char representations of these types of things (in our industry models this is standard as well), so I would do:

data art;
  input id id_c date1 date2;
datalines;
343 565 1.8362E9 .
3435 4546 . -3.592E9
;
run;
 
proc format;
  picture dtpic
    other='%Y-%0m-%0d %0H:%0M:%0S ' ( datatype=datetime);
run;

data test;
  set art;
  if date1 ne . then char_date1=put(date1,dtpic.);
  if date2 ne . then char_date2=put(date2,dtpic.);
run;

I would question why you do not use T to separate date and time, as shown in standard - and that is international standard - ISO dates, e.g:

YYYY-MM-DDTHH:MM.SS

 

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
  • 17 replies
  • 4015 views
  • 7 likes
  • 6 in conversation