<?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: Convert Julian to numeric date format yyyymmdd10. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750185#M235903</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117082"&gt;@Vigneswar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;Let's take my input is 1992-05-17 stored as numeric (from source).&lt;BR /&gt;.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does that mean?&amp;nbsp; 1992-05-17 is not a number.&amp;nbsp; Numbers do not have hyphens in them.&lt;/P&gt;
&lt;P&gt;Do you have a numeric variable with the YYMMDD10. format attached to it?&amp;nbsp; So the number 11,825 is stored in the variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it numeric with some datetime format attached to it?&amp;nbsp; So that the value is actually somewhere between&amp;nbsp;1,021,680,000&lt;BR /&gt;and 1,021,766,400?&lt;BR /&gt;Or is it a character variable?&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 13:01:37 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-06-24T13:01:37Z</dc:date>
    <item>
      <title>Convert Julian to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750121#M235873</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to find age of customer by using a column which has Julian date as the date of birth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my input,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;customer_dob = 92138&lt;/P&gt;
&lt;P&gt;changed_dt = 17-05-1992&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dob = intck('year',today,changed_dt);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to know a way to get the changed_dt in the above format stored as a numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any thoughts??&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 09:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750121#M235873</guid>
      <dc:creator>Vigneswar</dc:creator>
      <dc:date>2021-06-24T09:22:04Z</dc:date>
    </item>
    <item>
      <title>Convert Julian date to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750122#M235877</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to find age of customer by using a column which has Julian date as the date of birth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my input,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;customer_dob = 92138&lt;/P&gt;
&lt;P&gt;changed_dt = 17-05-1992&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dob = intck('year',today,changed_dt);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to know a way to get the changed_dt in the above format stored as a numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any thoughts??&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 09:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750122#M235877</guid>
      <dc:creator>Vigneswar</dc:creator>
      <dc:date>2021-06-24T09:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750125#M235875</link>
      <description>&lt;P&gt;Is customer_dob a character or numeric variable?&lt;/P&gt;
&lt;P&gt;If character&lt;/P&gt;
&lt;P&gt;changed_dt = input(customer_dob , julian5.);&lt;/P&gt;
&lt;P&gt;If numeric and always 5 digits:&lt;/P&gt;
&lt;P&gt;changed_dt = input(put(customer_dob,z5.) , julian5.);&lt;/P&gt;
&lt;P&gt;The input function requires character input so if the value is numeric you need to create a character value. The z5 would be needed to place a leading zero if the "year" was 2000 to 2009 where the year component would be 00 to 09 and SAS numerics do not internally store leading zeroes.&lt;/P&gt;
&lt;P&gt;If your customer_dob has a mix of 7 and "5" digits, i.e. some of the years are 1992 and others are 92 you will have to examine the value and decide whether to use Julian5 or Julian7 as the informat in the Input function.&lt;/P&gt;
&lt;P&gt;Or go back to where the data was read into SAS and use a data step to read the data and set the proper Julian informat from the beginning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then assign a format to changed_dt with : format changed_dt ddmmyyd10. ;&lt;/P&gt;
&lt;P&gt;so the default display will be as you show. The last d sets a hyphen as the separator between day, month and year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to use today() with the () to use the function. If you don't you'll likely get warnings about uninitialized variable Today.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 09:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750125#M235875</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-24T09:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian date to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750127#M235878</link>
      <description>&lt;P&gt;Duplicate posts combined.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 09:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750127#M235878</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-24T09:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750140#M235886</link>
      <description>Thanks for the reply...&lt;BR /&gt;&lt;BR /&gt;input statement is not working in DS2 code.&lt;BR /&gt;&lt;BR /&gt;Let's take my input is 1992-05-17 stored as numeric (from source).&lt;BR /&gt;&lt;BR /&gt;I want to calculate the age of each customer.</description>
      <pubDate>Thu, 24 Jun 2021 10:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750140#M235886</guid>
      <dc:creator>Vigneswar</dc:creator>
      <dc:date>2021-06-24T10:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750146#M235890</link>
      <description>&lt;P&gt;Please supply your incoming dataset as code, in a data step with datalines. Only then can we be sure about variable atttributes and contents. Right now I have no idea at all if your variables are in fact numeric or character.&lt;/P&gt;
&lt;P&gt;If you're not sure about dataset metadata, run a PROC CONTENTS and show us the definitions of the variables you work with.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 10:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750146#M235890</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-06-24T10:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750185#M235903</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117082"&gt;@Vigneswar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;Let's take my input is 1992-05-17 stored as numeric (from source).&lt;BR /&gt;.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does that mean?&amp;nbsp; 1992-05-17 is not a number.&amp;nbsp; Numbers do not have hyphens in them.&lt;/P&gt;
&lt;P&gt;Do you have a numeric variable with the YYMMDD10. format attached to it?&amp;nbsp; So the number 11,825 is stored in the variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it numeric with some datetime format attached to it?&amp;nbsp; So that the value is actually somewhere between&amp;nbsp;1,021,680,000&lt;BR /&gt;and 1,021,766,400?&lt;BR /&gt;Or is it a character variable?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 13:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750185#M235903</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-24T13:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian date to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750191#M235906</link>
      <description>&lt;P&gt;Bit guessing what you're really asking for. Is below doing what you need? If so then shouldn't be an issue to use such syntax in DS2.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  customer_dob_jul = 92138;
  customer_dob_sas = datejul(customer_dob_jul);
  age=yrdif(datejul(customer_dob_jul),today(),'age');
  format customer_dob_sas 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="Patrick_0-1624540188602.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60718i998208F1968AA989/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1624540188602.png" alt="Patrick_0-1624540188602.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 13:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750191#M235906</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-06-24T13:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750221#M235924</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117082"&gt;@Vigneswar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for the reply...&lt;BR /&gt;&lt;BR /&gt;input statement is not working in DS2 code.&lt;BR /&gt;&lt;BR /&gt;Let's take my input is 1992-05-17 stored as numeric (from source).&lt;BR /&gt;&lt;BR /&gt;I want to calculate the age of each customer.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your question did not mention DS2 in any form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1992-05-17 is not in any way a number so I am not sure how it can be "stored as a number".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since DS2 usually means connecting to a an external data source you likely need to tell us which source. Depending on that source and the actual values stored you may be looking for the date and time conversion functions such as TO_DOUBLE or TO_DATE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:39:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750221#M235924</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-24T14:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750236#M235934</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117082"&gt;@Vigneswar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for the reply...&lt;BR /&gt;&lt;BR /&gt;input statement is not working in DS2 code.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use INPUTC and INPUTN instead, which are available in DS2.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750236#M235934</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-06-24T15:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian date to numeric date format yyyymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750363#M236017</link>
      <description>&lt;P&gt;The datejul() function converts Julian to a SAS Date value&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;datejul(customer_dob_jul);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 23:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Julian-to-numeric-date-format-yyyymmdd10/m-p/750363#M236017</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-06-24T23:26:04Z</dc:date>
    </item>
  </channel>
</rss>

