<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: proc format: with conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955382#M373130</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I see what you want to do now, but I would never do it that way. I used to do work for attorneys for court cases and we would never be able to change the original data as you show. We could alter the format for display on reports or we could make a new variable based on the original variable, but we were not allowed to alter any of our original data -- we always had to be able to go back to the original data and show where it had been transformed. So if I still worked for attorneys, I'd have to leave DDATE alone and then either make a new character variable (if the string 'Date Not Exist' absolutely needed to be in the WANT dataset or I'd just make a new numeric variable and apply the format for display purposes:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1736280522408.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103535i2953D447FF28E38D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1736280522408.png" alt="Cynthia_sas_0-1736280522408.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this example, the WANT program uses the SAME format that I created previously:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
  length change_date_value_char $15;
  set have;
  change_date_value_char = put(ddate,dtfmt.);
  change_date_value_num = ddate;
  format change_date_value_num dtfmt. ddate date9.;
  label ddate='Original Data Value'
        change_date_value_char = 'Character Date Value'
		change_date_value_num = 'New Date with DTFMT applied';
run;
proc print data=want label;
  var ddate change_date_value_char change_date_value_num;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jan 2025 20:10:32 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2025-01-07T20:10:32Z</dc:date>
    <item>
      <title>proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955333#M373107</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to add format to ddate field in the following way:&lt;/P&gt;
&lt;P&gt;IF&amp;nbsp; the date is 01/01/1900 then it would show " Date not exist"&lt;/P&gt;
&lt;P&gt;and in other cases will show the date&lt;/P&gt;
&lt;P&gt;So;&lt;/P&gt;
&lt;P&gt;01JAN1900&amp;nbsp; --will show&amp;nbsp; Date not exist&lt;BR /&gt;01JAN1900&amp;nbsp; --will show&amp;nbsp; Date not exist&lt;BR /&gt;15DEC2023&amp;nbsp; --will show&amp;nbsp;15/12/2023&lt;BR /&gt;16JAN2024--will show&amp;nbsp;16/01/2024&lt;BR /&gt;07SEP2021--will show&amp;nbsp;07/09/2021&lt;/P&gt;
&lt;P&gt;what is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
format ddate ddmmyy10.;
input ddate : date9.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2025 16:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955333#M373107</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-07T16:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955346#M373114</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You just need a nested format as shown in the doc&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p1upn25lbfo6mkn1wncu4dyh9q91.htm#p1qm5zk6r6t9i1n1sq6xpqzp4753" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p1upn25lbfo6mkn1wncu4dyh9q91.htm#p1qm5zk6r6t9i1n1sq6xpqzp4753&lt;/A&gt;&amp;nbsp;and in this example:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1736272400884.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103522iBAF28AB069839D93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1736272400884.png" alt="Cynthia_sas_0-1736272400884.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically a nested format is where you define a format that references another format, which is your use case.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 17:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955346#M373114</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2025-01-07T17:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955348#M373115</link>
      <description>&lt;P&gt;Why not convert all instances of 01JAN1900 to missing values?&amp;nbsp; Either by recoding:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if ddate='01jan1900'd then ddate=.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or through a customized informat:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  invalue mydat
      '01JAN1900'=.
      other=[date9.];
run;

data have;
  format ddate ddmmyy10.;
  input ddate :mydat.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will allow more appropriate treatment of dates and date intervals in subsequent DATA steps and PROCs.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 18:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955348#M373115</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2025-01-07T18:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955354#M373118</link>
      <description>&lt;P&gt;It is not working,&lt;/P&gt;
&lt;P&gt;I want to apply it on have data set but do it when create want data set&amp;nbsp; (I dont want to do it in the data step with cards statement because in real word I dont create the data set with dates and only get it as external data set)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data have;
format ddate ddmmyy10.;
input ddate : date9.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;


proc format;
invalue mydate
'01JAN1900'=.
other=[date9.];
run;


data want;
set have;
informat ddate mydate.;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2025 18:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955354#M373118</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-07T18:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955356#M373119</link>
      <description>&lt;P&gt;I have tried but it didnt work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
format ddate ddmmyy10.;
input ddate : date9.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;

proc format;
invalue mydate
'01JAN1900'='n/a';
other=[date9.];
run;


data want;
set have;
format ddate mydate.;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2025 18:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955356#M373119</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-07T18:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955357#M373120</link>
      <description>&lt;P&gt;This is a great solution, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;! One alternative option is to use a &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p0n990vq8gxca6n1vnsracr6jp2c.htm" target="_blank" rel="noopener"&gt;picture format&lt;/A&gt; which is a powerful way to have a high level of control on how you'd like to display dates and datetimes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    picture ddmmyydne
        '01JAN1900'd = 'Date not exist'
        other        = '%0d/%m/%Y' (datatype=date)
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=have;
    format ddate ddmmyydne.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_0-1736277540645.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103533i90C6AA3A2AE3BEBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_0-1736277540645.png" alt="Stu_SAS_0-1736277540645.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 19:19:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955357#M373120</guid>
      <dc:creator>Stu_SAS</dc:creator>
      <dc:date>2025-01-07T19:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955367#M373124</link>
      <description>&lt;P&gt;You're close! Let's look at this from a few different angles. The way you originally described your dataset indicates that your dates come in as SAS dates already. If this is the case, then you only need to use a single format statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value mydate
        '01JAN1900'd='Date not exist'
        other=[ddmmyy10.];
run;

data want;
    set have;
    format ddate mydate.;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_0-1736277421386.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103530i7898EEB62926132D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_0-1736277421386.png" alt="Stu_SAS_0-1736277421386.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your dates are strings, then you need to first convert the string date to a SAS date and apply your format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ddate$9.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;

proc format;
    value mydate
        '01JAN1900'd='Date not exist'
        other=[ddmmyy10.];
run;

data want;
    set have;    
    format ddate2 mydate.;
    ddate2 = input(ddate, date9.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_1-1736277455515.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103531iE55B52A33499A67C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_1-1736277455515.png" alt="Stu_SAS_1-1736277455515.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the data to always be a string without needing to use if-then-else, use the PUT function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ddate$9.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;

proc format;
    value mydate
        '01JAN1900'd='Date not exist'
        other=[ddmmyy10.];
run;

data want;
    length ddate $14.;
    set have;    
    ddate = put(input(ddate, date9.), mydate.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_2-1736277488752.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103532i38E9DD54779BC83A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_2-1736277488752.png" alt="Stu_SAS_2-1736277488752.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 19:19:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955367#M373124</guid>
      <dc:creator>Stu_SAS</dc:creator>
      <dc:date>2025-01-07T19:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955370#M373125</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It is not working,&lt;/P&gt;
&lt;P&gt;I want to apply it on have data set but do it when create want data set&amp;nbsp; (I dont want to do it in the data step with cards statement because in real word I dont create the data set with dates and only get it as external data set)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data have;
format ddate ddmmyy10.;
input ddate : date9.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;


proc format;
invalue mydate
'01JAN1900'=.
other=[date9.];
run;


data want;
set have;
informat ddate mydate.;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The INFORMAT is useful only for an INPUT statement or function.&amp;nbsp; You ignored my first alternative, meant for modify data that has already been input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if ddate='01jan1900'd then ddate=.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which would allow all subsequent uses of the data to recognize the date as a missing value.&amp;nbsp; (useful for reporting date ranges for your data, or for generating derived dates, but only from non-missing DDATEs).&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 19:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955370#M373125</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2025-01-07T19:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955375#M373126</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have tried but it didnt work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
format ddate ddmmyy10.;
input ddate : date9.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;

proc format;
invalue mydate
'01JAN1900'='n/a';
other=[date9.];
run;


data want;
set have;
format ddate mydate.;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For Cynthia's format approach, you need a VALUE statement, not INVALUE.&amp;nbsp; You're also missing the d after the date literal '01JAN1900' and you have an extra semicolon.&amp;nbsp; When you run that code, you should see lots of helpful error messages in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value mydate
'01JAN1900'd='n/a'
other=[date9.];
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2025 19:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955375#M373126</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-01-07T19:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955378#M373127</link>
      <description>&lt;P&gt;My likely solution to this would look more like:&lt;/P&gt;
&lt;PRE&gt;proc format;
invalue mydate
'01JAN1900'=.N
other=[date9.];
value mydate
.N='Date not exist'
other=[ddmmyy10.];
run;


data have;
format ddate ddmmyy10.;
input ddate : mydate.;
format ddate mydate.;
cards;
01JAN1900
01JAN1900
15DEC2023
16JAN2024
07SEP2021
;
Run;&lt;/PRE&gt;
&lt;P&gt;This use of a special missing from the custom informat would differentiate the result from any other malformed or missing "date" input. The custom format would also let you know that other missing "dates" were not the special original value and could be handled differently when needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Special missing such as the .N (or any of the other .letter or ._) can be tested in comparisons such as :&lt;/P&gt;
&lt;PRE&gt;if ddate = .N then &amp;lt;do something that might differ from simple missing&amp;gt;;&lt;/PRE&gt;
&lt;P&gt;but the values are still missing for purposes like calculations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 19:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955378#M373127</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-01-07T19:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955382#M373130</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I see what you want to do now, but I would never do it that way. I used to do work for attorneys for court cases and we would never be able to change the original data as you show. We could alter the format for display on reports or we could make a new variable based on the original variable, but we were not allowed to alter any of our original data -- we always had to be able to go back to the original data and show where it had been transformed. So if I still worked for attorneys, I'd have to leave DDATE alone and then either make a new character variable (if the string 'Date Not Exist' absolutely needed to be in the WANT dataset or I'd just make a new numeric variable and apply the format for display purposes:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1736280522408.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103535i2953D447FF28E38D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1736280522408.png" alt="Cynthia_sas_0-1736280522408.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this example, the WANT program uses the SAME format that I created previously:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
  length change_date_value_char $15;
  set have;
  change_date_value_char = put(ddate,dtfmt.);
  change_date_value_num = ddate;
  format change_date_value_num dtfmt. ddate date9.;
  label ddate='Original Data Value'
        change_date_value_char = 'Character Date Value'
		change_date_value_num = 'New Date with DTFMT applied';
run;
proc print data=want label;
  var ddate change_date_value_char change_date_value_num;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 20:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955382#M373130</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2025-01-07T20:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc format: with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955537#M373181</link>
      <description>Thanks&lt;BR /&gt;Indeed dates in my data set are sas dates. So as I see I has 2 mistakes.  1- forgot 'd  in the format definition  2- used information instead of format statement</description>
      <pubDate>Wed, 08 Jan 2025 20:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-with-conditions/m-p/955537#M373181</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-08T20:11:28Z</dc:date>
    </item>
  </channel>
</rss>

