Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mv_getjobcode.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mv_getjobcode macro
4
5 <h4> SAS Macros </h4>
6 @li mp_assert.sas
7 @li mv_createjob.sas
8 @li mv_getjobcode.sas
9
10**/
11
12/**
13 * Test Case 1
14 */
15
16/* write some code to a job */
17%let incode=%str(data test; set sashelp.class;run;);
18filename testref temp;
19data _null_;
20 file testref;
21 put "&incode";
22run;
23%mv_createjob(
24 code=testref,
25 path=&mcTestAppLoc/services/temp,
26 name=some_job
27)
28
29/* now get the code back */
30%mv_getjobcode(
31 path=&mcTestAppLoc/services/temp,
32 name=some_job,
33 outref=mycode
34)
35
36%let diditexist=NO;
37data work.test1;
38 infile mycode;
39 input;
40 putlog _infile_;
41 line=_infile_;
42 check=symget('incode');
43 if _infile_=symget('incode') then call symputx('diditexist','YES');
44run;
45
46%mp_assert(
47 iftrue=(&diditexist=NO),
48 desc=Check if the code that was sent was successfully retrieved
49)