Help using Base SAS procedures

SAS Format

Accepted Solution Solved
Reply
Contributor
Posts: 26
Accepted Solution

SAS Format

Hi All ,

i was just wondering if we have a sas format for "19 Aug , Mon". i have a date which needs to be converted to this format , do we have a inbuilt sas format which can give me this ? or any other way ?

Thanks

Keds


Accepted Solutions
Solution
‎06-27-2014 01:31 PM
Super User
Posts: 17,819

Re: SAS Format

If that's exactly your format then no, you'll need to "roll your own".

proc format;

    picture date_custom_fmt (Default=45)

        low - high = '%d %b, %a'

    (datatype = date);

run;

data have;

dt='01JUN2014'd;

format dt date_custom_fmt.;

run;

See pages 14+:

http://www2.sas.com/proceedings/sugi31/243-31.pdf

View solution in original post


All Replies
Trusted Advisor
Posts: 1,204

Re: SAS Format

Try this.

data have;

dt='01JUN2014'd;

format dt WEEKDATE.;

run;

proc print;

run;

Solution
‎06-27-2014 01:31 PM
Super User
Posts: 17,819

Re: SAS Format

If that's exactly your format then no, you'll need to "roll your own".

proc format;

    picture date_custom_fmt (Default=45)

        low - high = '%d %b, %a'

    (datatype = date);

run;

data have;

dt='01JUN2014'd;

format dt date_custom_fmt.;

run;

See pages 14+:

http://www2.sas.com/proceedings/sugi31/243-31.pdf

Contributor
Posts: 26

Re: SAS Format

stat@sas this is coming as Friday ,  1 Jun , 2014. wanted very specific like "19 Aug , Mon".

Thanks Reeza , this worked out as i wanted.

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 328 views
  • 0 likes
  • 3 in conversation