27 %initTestcase(i_object=generate.sas, i_desc=example with one by variable)
30 %_mkdir(&g_work/test1)
31 libname test1 "&g_work/test1";
32 %_mkdir(&g_work/test2)
33 libname test2 "&g_work/test2";
35 proc sort data=sashelp.class out=test2.class1 (label="Dataset for sex=F (9 observations)");
39 proc sort data=sashelp.class out=test2.class2 (label="Dataset for sex=M (10 observations)");
44 %generate(data=sashelp.class, by=sex, out=test1.class)
46 %assertLibrary(i_actual=test1, i_expected=test2, i_desc=check libraries)
50 %initTestcase(i_object=generate.sas, i_desc=example with two by variables)
51 proc datasets lib=test1 nolist kill;
53 proc datasets lib=test2 nolist kill;
55 proc sort data=sashelp.prdsale out=test2.prdsale1 (label="Dataset for region=EAST, year=1993 (360 observations)");
57 where region="EAST" and year=1993;
59 proc sort data=sashelp.prdsale out=test2.prdsale2 (label="Dataset for region=EAST, year=1994 (360 observations)");
61 where region="EAST" and year=1994;
63 proc sort data=sashelp.prdsale out=test2.prdsale3 (label="Dataset for region=WEST, year=1993 (360 observations)");
65 where region="WEST" and year=1993;
67 proc sort data=sashelp.prdsale out=test2.prdsale4 (label="Dataset for region=WEST, year=1994 (360 observations)");
69 where region="WEST" and year=1994;
71 %generate(data=sashelp.prdsale, by=region year, out=test1.prdsale)
73 %assertLibrary(i_actual=test1, i_expected=test2, i_desc=check libraries)
77 %initTestcase(i_object=generate.sas, i_desc=example with one by variable with only one value)
78 proc datasets lib=test1 nolist kill;
80 proc datasets lib=test2 nolist kill;
83 proc sort data=sashelp.class out=class;
88 proc sort data=sashelp.class out=test2.class1 (label="Dataset for sex=F (9 observations)");
92 %generate(data=class, by=sex, out=test1.class)
94 %assertLibrary(i_actual=test1, i_expected=test2, i_desc=check libraries)
98 %initTestcase(i_object=generate.sas, i_desc=invalid dataset)
99 proc datasets lib=test1 nolist kill;
101 proc datasets lib=test2 nolist kill;
103 %generate(data=sashelp.classXXX, by=sex, out=test1.class)
105 %assertLogMsg(i_logMsg=ERROR: Macro Generate: data= or by= specified incorrectly)
106 %endTestcase(i_assertLog=0)
109 %initTestcase(i_object=generate.sas, i_desc=invalid by variable)
110 proc datasets lib=test1 nolist kill;
112 proc datasets lib=test2 nolist kill;
114 %generate(data=sashelp.class, by=sexXXX, out=test1.class)
116 %assertLogMsg(i_logMsg=ERROR: Macro Generate: data= or by= specified incorrectly)
117 %endTestcase(i_assertLog=0)
120 %initTestcase(i_object=generate.sas, i_desc=invalid output library)
121 proc datasets lib=test1 nolist kill;
123 proc datasets lib=test2 nolist kill;
125 %generate(data=sashelp.class, by=sex, out=test3.class)
127 %assertLogMsg(i_logMsg=ERROR: (Libname|Libref) TEST3 is not assigned|ERROR: (Libname|Libref) TEST3 ist nicht zugewiesen
128 ,i_desc=regular expression used to support different languages
130 %endTestcase(i_assertLog=0)