Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mv_getjobstate.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mv_getjobstate macro
4
5 <h4> SAS Macros </h4>
6 @li mf_existvar.sas
7 @li mf_nobs.sas
8 @li mp_assert.sas
9 @li mp_assertscope.sas
10 @li mv_createjob.sas
11 @li mv_getjobstate.sas
12 @li mv_jobexecute.sas
13
14**/
15
16%let path=&mcTestAppLoc/jobs;
17
18filename ft15f001 temp;
19data _null_;
20 file ft15f001;
21 put 'data _null_;';
22 put ' put "executed to obtain a job uri";';
23 put 'run;';
24run;
25%mv_createjob(path=&path, name=statejob)
26%mv_jobexecute(path=&path, name=statejob, outds=work.joblinks)
27data _null_;
28 set work.joblinks;
29 if rel='state' then call symputx('stateuri',href,'l');
30run;
31%mp_assert(
32 iftrue=(%length(&stateuri)>0),
33 desc=Check the execution returned a state uri
34)
35
36%mp_assertscope(SNAPSHOT)
37%mv_getjobstate(uri=&stateuri, outds=work.jobstate)
38%mp_assertscope(COMPARE,
39 desc=mv_getjobstate does not leak scope,
40 outds=work.test_results
41)
42
43%mp_assert(
44 iftrue=(%sysfunc(exist(work.jobstate))=1),
45 desc=Check the job state dataset was created
46)
47%mp_assert(
48 iftrue=(%mf_nobs(work.jobstate)>0),
49 desc=Check a job state row was returned
50)
51%mp_assert(
52 iftrue=(%mf_existvar(work.jobstate,state)>0),
53 desc=Check the dataset carries a state column
54)