<?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: %providesurvivalmacros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/providesurvivalmacros/m-p/650968#M195243</link>
    <description>&lt;P&gt;Your data step wrote the macros to a local file. Then you skipped including them.&amp;nbsp; Look at the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%inc 'macros.tmp' / nosource;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2020 03:04:22 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2020-05-27T03:04:22Z</dc:date>
    <item>
      <title>%providesurvivalmacros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/providesurvivalmacros/m-p/650849#M195195</link>
      <description>&lt;P&gt;Using SAS 9.4 I am running the following code to format a KM curve:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;%let url = //support.sas.com/documentation/onlinedoc/stat/ex_code/151;&lt;BR /&gt;infile "http:&amp;amp;url/templft.html" device=url;&lt;/P&gt;&lt;P&gt;file 'macros.tmp';&lt;BR /&gt;retain pre 0;&lt;BR /&gt;input;&lt;BR /&gt;_infile_ = tranwrd(_infile_, '&amp;amp;amp;', '&amp;amp;');&lt;BR /&gt;_infile_ = tranwrd(_infile_, '&amp;amp;lt;' , '&amp;lt;');&lt;BR /&gt;if index(_infile_, '&amp;lt;/pre&amp;gt;') then pre = 0;&lt;BR /&gt;if pre then put _infile_;&lt;BR /&gt;if index(_infile_, '&amp;lt;pre&amp;gt;') then pre = 1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%ProvideSurvivalMacros /* variables available. */&lt;/P&gt;&lt;P&gt;%let TitleText0 = "Figure 2: Implant Survival Free of Reoperation for Infection"; /* Change the title. */&lt;BR /&gt;%let TitleText1 = &amp;amp;titletext0 " for " STRATUMID;&lt;BR /&gt;%let TitleText2 = &amp;amp;titletext0;&lt;BR /&gt;%let xOptions = label="Time to Implant Failure (in Months)"&lt;BR /&gt;linearopts=(viewmin=0 viewmax=132&lt;BR /&gt;tickvaluelist=(0 12 24 36 48 60 72 84 96 108 120 132));&lt;BR /&gt;%let GraphOpts = attrpriority=none&lt;BR /&gt;DataLinePatterns=(Solid ShortDash);&lt;BR /&gt;%CompileSurvivalTemplates /* Compile the templates with */&lt;BR /&gt;/* the new title. */&lt;/P&gt;&lt;P&gt;proc lifetest data = have plots=survival(test ATRISK(maxlen=50));&lt;BR /&gt;time TT_fail_months *failure2(0) ;&lt;BR /&gt;strata INDEX_TYPE_REV ;&lt;BR /&gt;label INDEX_TYPE_REV = 'Index Revision Type'&lt;BR /&gt;TT_fail_months = 'Time to Implant Failure (in Months)' ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%ProvideSurvivalMacros /* Optionally restore the default */&lt;BR /&gt;/* macros and macro variables. */&lt;/P&gt;&lt;P&gt;proc template; /* Delete the modified templates. */&lt;BR /&gt;delete Stat.Lifetest.Graphics.ProductLimitSurvival / store=sasuser.templat;&lt;BR /&gt;delete Stat.Lifetest.Graphics.ProductLimitSurvival2 / store=sasuser.templat;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has previously run and produced the KM curve as specified. I am returning to it a few months later and now it will not run. Any help would be welcomed. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my log:&lt;/P&gt;&lt;P&gt;204 data _null_;&lt;BR /&gt;205 %let url = //support.sas.com/documentation/onlinedoc/stat/ex_code/151;&lt;BR /&gt;206 infile "http:&amp;amp;url/templft.html" device=url;&lt;BR /&gt;207&lt;BR /&gt;208 file 'macros.tmp';&lt;BR /&gt;209 retain pre 0;&lt;BR /&gt;210 input;&lt;BR /&gt;211 _infile_ = tranwrd(_infile_, '&amp;amp;amp;', '&amp;amp;');&lt;BR /&gt;212 _infile_ = tranwrd(_infile_, '&amp;amp;lt;' , '&amp;lt;');&lt;BR /&gt;213 if index(_infile_, '&amp;lt;/pre&amp;gt;') then pre = 0;&lt;BR /&gt;214 if pre then put _infile_;&lt;BR /&gt;215 if index(_infile_, '&amp;lt;pre&amp;gt;') then pre = 1;&lt;BR /&gt;216 run;&lt;/P&gt;&lt;P&gt;NOTE: The infile "&lt;A href="http://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html&lt;/A&gt;"&lt;BR /&gt;is:&lt;BR /&gt;Filename=&lt;A href="http://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html&lt;/A&gt;,&lt;BR /&gt;Local Host Name=OCMRCRSLT014,&lt;BR /&gt;Local Host IP addr=fe80::f555:3075:e4:7d2c%24,&lt;BR /&gt;Service Hostname Name=support.sas.com,&lt;BR /&gt;Service IP addr=149.173.160.38,&lt;BR /&gt;Service Name=httpd,Service Portno=80,&lt;BR /&gt;Lrecl=32767,Recfm=Variable&lt;/P&gt;&lt;P&gt;NOTE: The file 'macros.tmp' is:&lt;BR /&gt;Filename=C:\Users\gscar\Desktop\HK073 Unresectable\macros.tmp,&lt;BR /&gt;RECFM=V,LRECL=32767,File Size (bytes)=0,&lt;BR /&gt;Last Modified=26May2020:13:30:31,&lt;BR /&gt;Create Time=21Feb2020:10:30:04&lt;/P&gt;&lt;P&gt;NOTE: 578 records were read from the infile&lt;BR /&gt;"&lt;A href="http://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html&lt;/A&gt;".&lt;BR /&gt;The minimum record length was 0.&lt;BR /&gt;The maximum record length was 1076.&lt;BR /&gt;NOTE: 361 records were written to the file 'macros.tmp'.&lt;BR /&gt;The minimum record length was 0.&lt;BR /&gt;The maximum record length was 80.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 4.74 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;WARNING: Apparent invocation of macro PROVIDESURVIVALMACROS not resolved.&lt;BR /&gt;217&lt;BR /&gt;218&lt;BR /&gt;219 %ProvideSurvivalMacros /* variables available. */&lt;BR /&gt;-&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;220&lt;BR /&gt;221 %let TitleText0 = "Figure 2: Implant Survival Free of Reoperation for Infection"; /*&lt;BR /&gt;221! Change the title. */&lt;BR /&gt;222 %let TitleText1 = &amp;amp;titletext0 " for " STRATUMID;&lt;BR /&gt;223 %let TitleText2 = &amp;amp;titletext0;&lt;BR /&gt;224 %let xOptions = label="Time to Implant Failure (in Months)"&lt;BR /&gt;225 linearopts=(viewmin=0 viewmax=132&lt;BR /&gt;226 tickvaluelist=(0 12 24 36 48 60 72 84 96 108 120 132));&lt;BR /&gt;227 %let GraphOpts = attrpriority=none&lt;BR /&gt;228 DataLinePatterns=(Solid ShortDash);&lt;BR /&gt;229 %CompileSurvivalTemplates /* Compile the templates with */&lt;BR /&gt;WARNING: Apparent invocation of macro COMPILESURVIVALTEMPLATES not resolved.&lt;BR /&gt;230 /* the new title. */&lt;BR /&gt;231&lt;BR /&gt;232 proc lifetest data = have plots=survival(test ATRISK(maxlen=50))&lt;BR /&gt;232! ;&lt;/P&gt;&lt;P&gt;233 time TT_fail_months *failure2(0) ;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;234 strata INDEX_TYPE_REV ;&lt;BR /&gt;------&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;235 label INDEX_TYPE_REV = 'Index Revision Type'&lt;BR /&gt;-----&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;236 TT_fail_months = 'Time to Implant Failure (in Months)' ;&lt;/P&gt;&lt;P&gt;WARNING: Apparent invocation of macro PROVIDESURVIVALMACROS not resolved.&lt;BR /&gt;237 run;&lt;BR /&gt;238&lt;BR /&gt;239 %ProvideSurvivalMacros /* Optionally restore the default */&lt;BR /&gt;-&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;240 /* macros and macro variables. */&lt;BR /&gt;241&lt;BR /&gt;242 proc template;&lt;/P&gt;&lt;P&gt;242! /* Delete the modified templates. */&lt;BR /&gt;243 delete Stat.Lifetest.Graphics.ProductLimitSurvival / store=sasuser.templat;&lt;BR /&gt;------&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;244 delete Stat.Lifetest.Graphics.ProductLimitSurvival2 / store=sasuser.templat;&lt;BR /&gt;------&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;245 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 17:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/providesurvivalmacros/m-p/650849#M195195</guid>
      <dc:creator>GS2</dc:creator>
      <dc:date>2020-05-26T17:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: %providesurvivalmacros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/providesurvivalmacros/m-p/650878#M195207</link>
      <description>From the log: WARNING: Apparent invocation of macro PROVIDESURVIVALMACROS not resolved.&lt;BR /&gt;&lt;BR /&gt;Did you run the code that creates the macro in your current SAS session before calling the macro?</description>
      <pubDate>Tue, 26 May 2020 18:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/providesurvivalmacros/m-p/650878#M195207</guid>
      <dc:creator>arthurcavila</dc:creator>
      <dc:date>2020-05-26T18:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: %providesurvivalmacros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/providesurvivalmacros/m-p/650968#M195243</link>
      <description>&lt;P&gt;Your data step wrote the macros to a local file. Then you skipped including them.&amp;nbsp; Look at the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%inc 'macros.tmp' / nosource;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 03:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/providesurvivalmacros/m-p/650968#M195243</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2020-05-27T03:04:22Z</dc:date>
    </item>
  </channel>
</rss>

