26 %initTestcase(i_object=generate.sas, i_desc=example with one by variable)
29 %_sasunit_mkdir(&g_work/test1)
30 libname test1 "&g_work/test1";
31 %_sasunit_mkdir(&g_work/test2)
32 libname test2 "&g_work/test2";
34 proc sort data=sashelp.class out=test2.class1 (label="Dataset for sex=F (9 observations)");
38 proc sort data=sashelp.class out=test2.class2 (label="Dataset for sex=M (10 observations)");
43 %generate(data=sashelp.class, by=sex, out=test1.class)
45 %assertLibrary(i_actual=test1, i_expected=test2, i_desc=check libraries)
49 %initTestcase(i_object=generate.sas, i_desc=example with two by variables)
50 proc datasets lib=test1 nolist kill;
52 proc datasets lib=test2 nolist kill;
54 proc sort data=sashelp.prdsale out=test2.prdsale1 (label="Dataset for region=EAST, year=1993 (360 observations)");
56 where region="EAST" and year=1993;
58 proc sort data=sashelp.prdsale out=test2.prdsale2 (label="Dataset for region=EAST, year=1994 (360 observations)");
60 where region="EAST" and year=1994;
62 proc sort data=sashelp.prdsale out=test2.prdsale3 (label="Dataset for region=WEST, year=1993 (360 observations)");
64 where region="WEST" and year=1993;
66 proc sort data=sashelp.prdsale out=test2.prdsale4 (label="Dataset for region=WEST, year=1994 (360 observations)");
68 where region="WEST" and year=1994;
70 %generate(data=sashelp.prdsale, by=region year, out=test1.prdsale)
72 %assertLibrary(i_actual=test1, i_expected=test2, i_desc=check libraries)
76 %initTestcase(i_object=generate.sas, i_desc=example with one by variable with only one value)
77 proc datasets lib=test1 nolist kill;
79 proc datasets lib=test2 nolist kill;
82 proc sort data=sashelp.class out=class;
87 proc sort data=sashelp.class out=test2.class1 (label="Dataset for sex=F (9 observations)");
91 %generate(data=class, by=sex, out=test1.class)
93 %assertLibrary(i_actual=test1, i_expected=test2, i_desc=check libraries)
97 %initTestcase(i_object=generate.sas, i_desc=invalid dataset)
98 proc datasets lib=test1 nolist kill;
100 proc datasets lib=test2 nolist kill;
102 %generate(data=sashelp.classXXX, by=sex, out=test1.class)
104 %assertLogMsg(i_logMsg=ERROR: Macro Generate: data= or by= specified incorrectly)
105 %endTestcase(i_assertLog=0)
108 %initTestcase(i_object=generate.sas, i_desc=invalid by variable)
109 proc datasets lib=test1 nolist kill;
111 proc datasets lib=test2 nolist kill;
113 %generate(data=sashelp.class, by=sexXXX, out=test1.class)
115 %assertLogMsg(i_logMsg=ERROR: Macro Generate: data= or by= specified incorrectly)
116 %endTestcase(i_assertLog=0)
119 %initTestcase(i_object=generate.sas, i_desc=invalid output library)
120 proc datasets lib=test1 nolist kill;
122 proc datasets lib=test2 nolist kill;
124 %generate(data=sashelp.class, by=sex, out=test3.class)
126 %assertLogMsg(i_logMsg=ERROR: Libname TEST3 is not assigned|ERROR: Libname TEST3 ist nicht zugewiesen
127 ,i_desc=regular expression used to support different languages
129 %endTestcase(i_assertLog=0)