Desktop productivity for business analysts and programmers

how to convert a date ddmmyyn8 to ddmmyy10.

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 119
Accepted Solution

how to convert a date ddmmyyn8 to ddmmyy10.

hello,

 

I would like to know if there is a way to convert a date (ddmmyyn8) to another date format (ddmmyy10) using proc sql alter table modify?

Regards,

 


Accepted Solutions
Solution
3 weeks ago
Super User
Posts: 9,925

Re: how to convert a date ddmmyyn8 to ddmmyy10.


@alepage wrote:

Hello,

 

I am not familiar with proc dataset.

 

However, I have tried this peace of code and it seems to work.

 

Is It correct?

 

 

proc datasets lib=work;
modify BaseAV2017;
format EffDate yymmdd10.;
quit;


This is correct. It only changes the header information of the dataset and is therefore very efficient.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
Super User
Posts: 9,925

Re: how to convert a date ddmmyyn8 to ddmmyy10.

For "attribute surgery" like that, proc datasets is the method of choice.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Frequent Contributor
Posts: 119

Re: how to convert a date ddmmyyn8 to ddmmyy10.

Posted in reply to KurtBremser

Hello,

 

I am not familiar with proc dataset.

 

However, I have tried this peace of code and it seems to work.

 

Is It correct?

 

 

proc datasets lib=work;
modify BaseAV2017;
format EffDate yymmdd10.;
quit;

Solution
3 weeks ago
Super User
Posts: 9,925

Re: how to convert a date ddmmyyn8 to ddmmyy10.


@alepage wrote:

Hello,

 

I am not familiar with proc dataset.

 

However, I have tried this peace of code and it seems to work.

 

Is It correct?

 

 

proc datasets lib=work;
modify BaseAV2017;
format EffDate yymmdd10.;
quit;


This is correct. It only changes the header information of the dataset and is therefore very efficient.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Frequent Contributor
Posts: 119

Re: how to convert a date ddmmyyn8 to ddmmyy10.

Posted in reply to KurtBremser

Thanks a lot for your Help Kurt

Best Regards

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 124 views
  • 0 likes
  • 2 in conversation