<?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: My INTCK code is changing '0' to . in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938544#M42173</link>
    <description>&lt;P&gt;I have loaded the code and log into the "running man" box twice and clicked ok. Let me try again. Not sure what I am doing wrong. First time I have posted here. So sorry.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Data GRC2;
     Set GRC1;
     
/* AgeAtVisit calculation if not provided*/
  / if AgeAtVisit= 0 then AgeAtVisit = intck(‘dtDay’,VisitDate,DOB);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         Data GRC2;
 70              Set GRC1;
 71         
 72         /* AgeAtVisit calculation if not provided*/
 73           / if AgeAtVisit= 0 then AgeAtVisit = intck(‘dtDay’,VisitDate,DOB);
              _
              180
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 
 74         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.GRC2 may be incomplete.  When this step was stopped there were 0 observations and 13 variables.
 WARNING: Data set WORK.GRC2 was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              918.65k
       OS Memory           24236.00k
       Timestamp           08/07/2024 02:45:38 PM
       Step Count                        121  Switch Count  0
       Page Faults                       0
       Page Reclaims                     116
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           8
       
 
 75         
 76         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 86         
 User: u63971301&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2024 14:48:59 GMT</pubDate>
    <dc:creator>Susanknoll727</dc:creator>
    <dc:date>2024-08-07T14:48:59Z</dc:date>
    <item>
      <title>My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938514#M42167</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am working on a dataset in SAS Studio, which I have never worked on before. I have VISITDATE and DOB variables and AGEATVISIT (all numeric). There are a handful of the AGE that are 0 that I would like to calculate the age for. Below is my code and Log included. What is wrong with my code? Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 13:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938514#M42167</guid>
      <dc:creator>Susanknoll727</dc:creator>
      <dc:date>2024-08-07T13:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938518#M42168</link>
      <description>&lt;P&gt;Seems you did not post your code or log?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 13:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938518#M42168</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2024-08-07T13:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938519#M42169</link>
      <description>&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thought I did. Let me try again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 13:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938519#M42169</guid>
      <dc:creator>Susanknoll727</dc:creator>
      <dc:date>2024-08-07T13:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938524#M42170</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/467908"&gt;@Susanknoll727&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am working on a dataset in SAS Studio, which I have never worked on before. I have VISITDATE and DOB variables and AGEATVISIT (all numeric). There are a handful of the AGE that are 0 that I would like to calculate the age for. Below is my code and Log included. What is wrong with my code? Thank you!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Include some of the values of Visitdate and DOB that have this result.&lt;/P&gt;
&lt;P&gt;If using INTCK and either of the date values used is missing OR contains a numeric value that is not a valid date the result would be missing.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 13:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938524#M42170</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-08-07T13:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938527#M42171</link>
      <description>&lt;P&gt;I have attached the dataset - it is fake data. Lines 31, 65, and 99.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 14:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938527#M42171</guid>
      <dc:creator>Susanknoll727</dc:creator>
      <dc:date>2024-08-07T14:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938539#M42172</link>
      <description>&lt;P&gt;And your code / log is ?&lt;/P&gt;
&lt;P&gt;It should be fairly simple to copy text from the editor or log window. Then on the forum open a text box using the &amp;lt;/&amp;gt; icon that appears above the main message window and paste the text.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 14:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938539#M42172</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-08-07T14:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938544#M42173</link>
      <description>&lt;P&gt;I have loaded the code and log into the "running man" box twice and clicked ok. Let me try again. Not sure what I am doing wrong. First time I have posted here. So sorry.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Data GRC2;
     Set GRC1;
     
/* AgeAtVisit calculation if not provided*/
  / if AgeAtVisit= 0 then AgeAtVisit = intck(‘dtDay’,VisitDate,DOB);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         Data GRC2;
 70              Set GRC1;
 71         
 72         /* AgeAtVisit calculation if not provided*/
 73           / if AgeAtVisit= 0 then AgeAtVisit = intck(‘dtDay’,VisitDate,DOB);
              _
              180
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 
 74         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.GRC2 may be incomplete.  When this step was stopped there were 0 observations and 13 variables.
 WARNING: Data set WORK.GRC2 was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              918.65k
       OS Memory           24236.00k
       Timestamp           08/07/2024 02:45:38 PM
       Step Count                        121  Switch Count  0
       Page Faults                       0
       Page Reclaims                     116
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           8
       
 
 75         
 76         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 86         
 User: u63971301&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 14:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938544#M42173</guid>
      <dc:creator>Susanknoll727</dc:creator>
      <dc:date>2024-08-07T14:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938549#M42174</link>
      <description>&lt;P&gt;The Error&amp;nbsp; you get is pretty clear, you have a / in the code where it doesn't belong. So nothing was actually done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, the 'dtday' value for interval in INTCK or INTNX function would be to use the date part of a DATETIME values, which are stored as numbers of seconds.&lt;/P&gt;
&lt;P&gt;Unless you did something pretty unnatural with the date vales shown in your CSV, which appear to be mm/dd/yyyy values such as VisitDate = 10/20/2030 and should be DATE values (number of days).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It also would be returning the number of day boundaries between the dates.&lt;/P&gt;
&lt;P&gt;If you want an age in years the interval would be 'year' for date values. However the way that INTCK works the result of a 'year' when the start date is 31DEC2020 and the end date is 01JAN2021 by default is 1 because the year boundary occurs between the two dates. To use Intck to get reasonable age in years the way most of count age you add the method='C' (or 'Continuous') so the length of a year is considered, not the date of the year boundary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   age = intck('year','17JUN1987'd,'20APR2030'd,'C');
run;&lt;/PRE&gt;
&lt;P&gt;You may want to share the results of running Proc Contents on your GRC1 data set to confirm the variable types, informats and formats.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938549#M42174</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-08-07T15:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938550#M42175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/467908"&gt;@Susanknoll727&lt;/a&gt;, from the log you posted it looks like SAS is trying to draw your attention to the extra &lt;FONT color="#FF0000"&gt;/&lt;/FONT&gt; in from of the IF statement. Remove that and run your program again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 73           &lt;FONT color="#FF0000"&gt;/&lt;/FONT&gt; if AgeAtVisit= 0 then AgeAtVisit = intck(‘dtDay’,VisitDate,DOB);
              &lt;FONT color="#FF0000"&gt;_&lt;/FONT&gt;
              180
&lt;FONT color="#FF0000"&gt; ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938550#M42175</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2024-08-07T15:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938551#M42176</link>
      <description>&lt;P&gt;Hi Anton,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. I removed that. Unfortunately that did not fix the problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938551#M42176</guid>
      <dc:creator>Susanknoll727</dc:creator>
      <dc:date>2024-08-07T15:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938554#M42177</link>
      <description>&lt;P&gt;Thank you . Does this mean I would code for those three observations?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938554#M42177</guid>
      <dc:creator>Susanknoll727</dc:creator>
      <dc:date>2024-08-07T15:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938555#M42178</link>
      <description>&lt;P&gt;If you could repost your log once you run the new code and a few observations, it would help us to detect the issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938555#M42178</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2024-08-07T15:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938557#M42179</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Susanknoll727_0-1723044940554.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99093iEABB0410A70CDA4D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Susanknoll727_0-1723044940554.png" alt="Susanknoll727_0-1723044940554.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938557#M42179</guid>
      <dc:creator>Susanknoll727</dc:creator>
      <dc:date>2024-08-07T15:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938573#M42180</link>
      <description>&lt;P&gt;Your variables have DATE values (or at least they better since you have elected to display them with the MMDDYY format which only works correctly on date values).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to get the number of days, which is what it looks like you wanted to try to do, you can just subtract the two date values.&amp;nbsp; Date values are stored in days.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you really want AGE calculated in DAYS?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 16:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938573#M42180</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-08-07T16:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: My INTCK code is changing '0' to .</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938579#M42181</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/467908"&gt;@Susanknoll727&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you . Does this mean I would code for those three observations?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Modify your existing code&lt;/P&gt;
&lt;PRE&gt;/ if AgeAtVisit= 0 then AgeAtVisit = intck(&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;‘&lt;/STRONG&gt;&lt;/FONT&gt;dtDay&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;’&lt;/STRONG&gt;&lt;/FONT&gt;,VisitDate,DOB);&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;if AgeAtVisit= 0 then AgeAtVisit = intck('year',VisitDate,DOB,'C');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note your existing code has a second problem which may indicate you copied the DTDAY option from some other source and that is the presences of the curly or "smart" quotes. Please note the highlighted quotes in the first code that I colored red and made large. Those are not acceptable in SAS code for use in quoting. You have to replace them with the typed quote or double-quote character from your keyboard. Copying code from websites or files opened in anything except plain text or programming editors is the most likely source of the incompatible characters. So watch out for such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: Saying "doesn't work" or similar really requires showing the LOG from what didn't happen. Otherwise we have no idea what code was submitted or what issues SAS may have objected to.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 17:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-INTCK-code-is-changing-0-to/m-p/938579#M42181</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-08-07T17:29:59Z</dc:date>
    </item>
  </channel>
</rss>

