22%mp_assertscope(SNAPSHOT)
23%mp_ds2csv(work.somedata,outfile=
"&sasjswork/test1.csv")
24%mp_assertscope(COMPARE)
28 infile
"&sasjswork/test1.csv";
31 if _n_=1 then call symputx(
'test1a',_infile_);
32 else if _infile_=:
'1," t""w""o",.Z' then call symputx(
'test1b',
'PASS');
36 iftrue=(
"&test1a"=
"x factor, Y, Z"),
37 desc=Checking header row Test 1,
38 outds=work.test_results
41 iftrue=(
"&test1b"=
"PASS"),
42 desc=Checking data row Test 1,
43 outds=work.test_results
49filename test2 "&sasjswork/test2.csv";
50%mp_ds2csv(work.somedata,outref=test2,dlm=SEMICOLON,headerformat=NAME)
57 if _n_=1 then call symputx('test2a',_infile_);
58 else if _infile_=:'1;" t""w""o";.Z' then call symputx('test2b','PASS');
62 iftrue=("&test2a"="X; Y; Z"),
63 desc=Checking header row Test 2,
64 outds=work.test_results
67 iftrue=("&test2b"="PASS"),
68 desc=Checking data row Test 2,
69 outds=work.test_results
75filename test3 "&sasjswork/test3.csv";
76%mp_ds2csv(work.somedata,outref=test3,headerformat=SASJS)
83 if _n_=1 then call symputx('test3a',_infile_);
84 else if _infile_=:'1," t""w""o",.Z' then call symputx('test3b','PASS');
88 iftrue=("&test3a"="X:best32. Y:$char7. Z:best32."),
89 desc=Checking header row Test 3,
90 outds=work.test_results
93 iftrue=("&test3b"="PASS"),
94 desc=Checking data row Test 3,
95 outds=work.test_results
101Name length= $18 label="Player's Name"
102Team length= $14 label="Team at the End of 1986"
103nAtBat length= 8 label="Times at Bat in 1986"
104nHits length= 8 label="Hits in 1986"
105nHome length= 8 label="Home Runs in 1986"
106nRuns length= 8 label="Runs in 1986"
107nRBI length= 8 label="RBIs in 1986"
108nBB length= 8 label="Walks in 1986"
109YrMajor length= 8 label="Years in the Major Leagues"
110CrAtBat length= 8 label="Career Times at Bat"
111CrHits length= 8 label="Career Hits"
112CrHome length= 8 label="Career Home Runs"
113CrRuns length= 8 label="Career Runs"
114CrRbi length= 8 label="Career RBIs"
115CrBB length= 8 label="Career Walks"
116League length= $8 label="League at the End of 1986"
117Division length= $8 label="Division at the End of 1986"
118Position length= $8 label="Position(s) in 1986"
119nOuts length= 8 label="Put Outs in 1986"
120nAssts length= 8 label="Assists in 1986"
121nError length= 8 label="Errors in 1986"
122Salary length= 8 label="1987 Salary in $ Thousands"
123Div length= $16 label="League and Division"
124logSalary length= 8 label="Log Salary"
153missing a b c d e f g h i j k l m n o p q r s t u v w x y z _;
155if not missing(logSalary) then logsalary=logSalary*1;
157"Allanson, Andy",Cleveland,293,66,1,30,29,14,1,293,66,1,30,29,14,American,East,C,446,33,20,.,AE,.
158"Ashby, Alan",Houston,315,81,7,24,38,39,14,3449,835,69,321,414,375,National,West,C,632,43,10,475,NW,6.16331480403464
159"Davis, Alan",Seattle,479,130,18,66,72,76,3,1624,457,63,224,266,263,American,West,1B,880,82,14,480,AW,6.17378610390193
160"Dawson, Andre",Montreal,496,141,20,65,78,37,11,5628,1575,225,828,838,354,National,East,RF,200,11,3,500,NE,6.21460809842219
161"Galarraga, Andres",Montreal,321,87,10,39,42,30,2,396,101,12,48,46,33,National,East,1B,805,40,4,91.5,NE,4.51633897228147
162"Griffin, Alfredo",Oakland,594,169,4,74,51,35,11,4408,1133,19,501,336,194,American,West,SS,282,421,25,750,AW,6.62007320653035
163"Newman, Al",Montreal,185,37,1,23,8,21,2,214,42,1,30,9,24,National,East,2B,76,127,7,70,NE,4.24849524204936
164"Salazar, Argenis",Kansas City,298,73,0,24,24,7,3,509,108,0,41,37,12,American,West,SS,121,283,9,100,AW,4.60517018598809
165"Thomas, Andres",Atlanta,323,81,6,26,32,8,2,341,86,6,32,34,8,National,West,SS,143,290,19,75,NW,4.31748811353631
166"Thornton, Andre",Cleveland,401,92,17,49,66,65,13,5206,1332,253,784,890,866,American,East,DH,0,0,0,1100,AE,7.00306545878646
167"Trammell, Alan",Detroit,574,159,21,107,75,59,10,4631,1300,90,702,504,488,American,East,SS,238,445,22,517.143,AE,6.24831943200756
168"Trevino, Alex",Los Angeles,202,53,4,31,26,27,9,1876,467,15,192,186,161,National,West,C,304,45,11,512.5,NW,6.23930071101256
169"Van Slyke, Andy",St Louis,418,113,13,48,61,47,4,1512,392,41,205,204,203,National,East,RF,211,11,7,550,NE,6.30991827822651
170"Wiggins, Alan",Baltimore,239,60,0,30,11,22,6,1941,510,4,309,103,207,American,East,2B,121,151,6,700,AE,6.5510803350434
171"Almon, Bill",Pittsburgh,196,43,7,29,27,30,13,3231,825,36,376,290,238,National,East,UT,80,45,8,240,NE,5.48063892334199
172"Beane, Billy",Minneapolis,183,39,3,20,15,11,3,201,42,3,20,16,11,American,West,OF,118,0,0,.,AW,.
173"Bell, Buddy",Cincinnati,568,158,20,89,75,73,15,8068,2273,177,1045,993,732,National,West,3B,105,290,10,775,NW,6.65286302935334
174"Biancalana, Buddy",Kansas City,190,46,2,24,8,15,5,479,102,5,65,23,39,American,West,SS,102,177,16,175,AW,5.16478597392351
175"Bochte, Bruce",Oakland,407,104,6,57,43,65,12,5233,1478,100,643,658,653,American,West,1B,912,88,9,.,AW,.
178filename example temp lrecl=5000;
179%mp_ds2csv(work.baseball,outref=example,headerformat=SASJS)
180data _null_; infile example; input;put _infile_; if _n_>5 then stop;run;
185 call symputx('stmnt',_infile_);
189 infile example dsd firstobs=2;
195 desc=Checking syscc prior to compare of work.baseball,
196 outds=work.test_results
199proc compare base=want compare=work.baseball
200 method = absolute criterion = 0.0000000001 ;
203 iftrue=(&sysinfo le 41),
204 desc=Checking compare of work.baseball,
205 outds=work.test_results
215 format x date9. y datetime19. z time.;
217%mp_ds2csv(work.test5,outref=f2,headerformat=SASJS)
218data _null_; infile example; input;put _infile_; if _n_>5 then stop;run;
224 call symputx('stmnt2',_infile_);
228 infile f2 dsd firstobs=2;
235 desc=Checking syscc prior to compare of test5,
236 outds=work.test_results
239proc compare base=want5 compare=work.test5;
242 iftrue=(&sysinfo le 41),
243 desc=Checking compare of work.test5,
244 outds=work.test_results