<?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: Checkpoint and restart from checkpoints: Can i amend the code after error and still restart? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Checkpoint-and-restart-from-checkpoints-Can-i-amend-the-code/m-p/607252#M176469</link>
    <description>&lt;P&gt;Split your code into usefully discrete parts (each in its own .sas file), and run them from a single shell script. Have the shell script look for a parameter that, if set, determines where to start:&lt;/P&gt;
&lt;PRE&gt;STEP=$1
if [[ $STEP &amp;lt; 2 ]]
then
  echo "running first program"
fi
if [[ $STEP &amp;lt; 3 ]]
then
  echo "running second program"
fi
&lt;/PRE&gt;
&lt;P&gt;When run without a parameter, it does this:&lt;/P&gt;
&lt;PRE&gt;user@server:/home/user $ ./test.sh
running first program
running second program
&lt;/PRE&gt;
&lt;P&gt;When run with parameters, it does this:&lt;/P&gt;
&lt;PRE&gt;user@server:/home/user $ ./test.sh 1
running first program
running second program
user@server:/home/user $ ./test.sh 2
running second program
user@server:/home/user $ ./test.sh 3
user@server:/home/user $ 
&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Nov 2019 10:05:46 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-11-26T10:05:46Z</dc:date>
    <item>
      <title>Checkpoint and restart from checkpoints: Can i amend the code after error and still restart?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checkpoint-and-restart-from-checkpoints-Can-i-amend-the-code/m-p/607245#M176465</link>
      <description>&lt;P&gt;Hi SAS Community&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS (foundation?) 9.4 and have about 10 programs, where the first 5 can run serially, and the next 5 can only run after the first ones are done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have therefore made a batch program that run the codes as I need them. Sometimes I need to make a change to the "downstream" program, so that I need to run the batch again. I usually run the batch at night, as it takes several hours to run. If I have made an error half way, it would be nice to be able to fix the code and rerun from that point, but in batch mode this is not immediately possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I discovered the checkpoint system, and if I understood correctly when I run the batch file i use this code (probably without nowirkinit):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sas -sysin 'c:\mysas\mysasprogram.sas' -stepchkpt -steprestart -noworkinit 
   -noworkterm  -errorcheck strict -errorabend&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If one of the programs fail, I can restart from checkpoint with this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sas -sysin 'c:\mysas\mysasprogram.sas' -stepchkpt -steprestart -stepchklib 
   mylibref -errorcheck strict -errorabend&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My question is if this works if I make changes to the sas program before I restart it? Will it recognize it as the same step and start from the correct checkpoint? Or is there some way to make "manual" checkpoints within the code, in which it can start from?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 09:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checkpoint-and-restart-from-checkpoints-Can-i-amend-the-code/m-p/607245#M176465</guid>
      <dc:creator>Gexern</dc:creator>
      <dc:date>2019-11-26T09:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Checkpoint and restart from checkpoints: Can i amend the code after error and still restart?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checkpoint-and-restart-from-checkpoints-Can-i-amend-the-code/m-p/607252#M176469</link>
      <description>&lt;P&gt;Split your code into usefully discrete parts (each in its own .sas file), and run them from a single shell script. Have the shell script look for a parameter that, if set, determines where to start:&lt;/P&gt;
&lt;PRE&gt;STEP=$1
if [[ $STEP &amp;lt; 2 ]]
then
  echo "running first program"
fi
if [[ $STEP &amp;lt; 3 ]]
then
  echo "running second program"
fi
&lt;/PRE&gt;
&lt;P&gt;When run without a parameter, it does this:&lt;/P&gt;
&lt;PRE&gt;user@server:/home/user $ ./test.sh
running first program
running second program
&lt;/PRE&gt;
&lt;P&gt;When run with parameters, it does this:&lt;/P&gt;
&lt;PRE&gt;user@server:/home/user $ ./test.sh 1
running first program
running second program
user@server:/home/user $ ./test.sh 2
running second program
user@server:/home/user $ ./test.sh 3
user@server:/home/user $ 
&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Nov 2019 10:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checkpoint-and-restart-from-checkpoints-Can-i-amend-the-code/m-p/607252#M176469</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-26T10:05:46Z</dc:date>
    </item>
  </channel>
</rss>

