postdata.test.2.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief testing postdata with format table
4 
5  <h4> SAS Macros </h4>
6  @li mp_testservice.sas
7  @li mp_assert.sas
8 
9 
10 **/
11 
12 
13 /**
14  * First part - stage some data (for diffing)
15  */
16 %let _program=&appLoc/services/editors/stagedata;
17 
18 data work.sascontroltable;
19  action='LOAD';
20  MESSAGE='Testing upload of a format catalog';
21  LIBDS="DCTEST.DCFMTS-FC";
22 run;
23 
24 proc format lib=DCTEST.DCFMTS cntlout=work.fmtextract;
25 run;
26 data work.jsdata;
27  set work.fmtextract;
28  if _n_<5 then _____DELETE__THIS__RECORD_____='Yes';
29  else _____DELETE__THIS__RECORD_____='No';
30  if _n_>12 then label=cats('new!',label);
31  if _n_>20 then stop;
32 run;
33 
34 %mp_testservice(&_program,
35  viyacontext=&defaultcontext,
36  inputdatasets=work.sascontroltable work.jsdata,
37  outlib=web1,
38  mdebug=&sasjs_mdebug
39 )
40 
41 %let status=0;
42 data work.sasparams;
43  set web1.sasparams;
44  putlog (_all_)(=);
45  if status='SUCCESS' then call symputx('status',1);
46  call symputx('dsid',dsid);
47 run;
48 
49 %mp_assert(
50  iftrue=(&status=1 and &syscc=0),
51  desc=Checking successful submission
52 )
53 
54 /**
55  * Now run postdata with SHOW_DIFFS
56  */
57 data work.sascontroltable;
58  ACTION='SHOW_DIFFS';
59  TABLE="&dsid";
60  DIFFTIME="%sysfunc(datetime(),B8601DT19.3)";
61  output;
62  stop;
63 run;
64 %mp_testservice(&appLoc/services/auditors/postdata,
65  viyacontext=&defaultcontext,
66  inputdatasets=work.sascontroltable,
67  outlib=web2,
68  outref=wbout
69 )
70 
71 
72 data _null_;
73  infile wbout;
74  input;
75  putlog _infile_;
76 run;
77