BookmarkSubscribeRSS Feed
Giuliano
Fluorite | Level 6


Hello,

I need to add checkpoints at each stage and a restart from checkpoint to the code below.  I will be running this code monthly and if it fails at any point, I will need to restart it at the point in which it failed, instead of rerunning the entire program again.  I would like to be notified as well if there is an error.  Would anyone be able to assist me with this?

PROC SQL;
CREATE TABLE work.mobpp1 AS
SELECT DISTINCT soc, feature_code, rate,
    datepart(effective_date)format=mmddyy10. AS effective_date,
    datepart(sys_creation_date)format=mmddyy10. AS sys_creation_date,
    datepart(expiration_date)format=mmddyy10. AS expiration_date,
    "&sysdate"d as Extract_Date format= MONYY7.
FROM bmlrwork.pp_rc_rate
WHERE feature_code NOT IN ('PNETRM');
QUIT;


PROC SQL;
CREATE TABLE work.mobpp2 AS
SELECT DISTINCT soc, soc_description, product_type, service_provider
FROM bmlrwork.soc;
QUIT;


PROC SQL;
CREATE TABLE work.mobpp3 AS
SELECT DISTINCT t1.soc, t1.feature_code, t1.rate, t1.effective_date, t1.sys_creation_date, t1.expiration_date,
    t2.soc_description, t2.product_type, t2.service_provider, t1.Extract_Date
FROM work.mobpp1 AS t1
LEFT JOIN work.mobpp2 AS t2
ON t1.soc = t2.soc;
QUIT;

PROC SORT data=work.mobpp3;
BY soc DESCENDING effective_date;
RUN;


DATA work.mobpp4;
SET work.mobpp3;
BY soc DESCENDING effective_date;
IF first.soc THEN OUTPUT;
RUN;


DATA RASHARE.GF_TEMP_MOBILITY_RC_JAN13 RASHARE.GF_TEMP_IPBB_RC_JAN13;
set work.mobpp4;
IF service_provider in ('ALL','MOBL')THEN OUTPUT RASHARE.GF_TEMP_MOBILITY_RC_JAN13;
ELSE OUTPUT RASHARE.GF_TEMP_IPBB_RC_JAN13;
RUN;

2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10

One technique is to have a permanent SAS control/progress tracking member which you would update after each key processing point, and then convert your SAS program to execute as a macro with %IF / %THEN %DO; %* your code goes here; %END; (condition code-piece execution) within the macro.  And at the end, a successful completion would again update the SAS control/progress tracking member accordingly.

Scott Barry

SBBWorks, Inc.

sowmya
Fluorite | Level 6

There are options in SAS Batch programming to assign as part of command line that you can use to add checkpoints.

You need to run your programs in modes- Checkpoint mode and restart mode to help ease of operations.

Here are the options that you can use:

stepchkpt

steprestart

noworkinit

noworkterm

errorcheck

errorabend

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1400 views
  • 3 likes
  • 3 in conversation