Sample 25389: Demonstrates Basic Files Generated from ODS MARKUP using DOCBOOK tagset
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample is from the SAS Sample Library. For additional information refer to "SAS Output Delivery System: User's Guide".
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: ODSMRK9 */
/* TITLE: Demonstrates Basic Files Generated from ODS MARKUP */
/* using DOCBOOK tagset */
/* PRODUCT: BASE */
/* SYSTEM: ALL */
/* KEYS: ODS MARKUP DOCBOOK */
/* PROCS: PRINT GLM */
/* DATA: */
/* */
/* SUPPORT: UPDATE: */
/* REF: */
/* MISC: */
/* */
/****************************************************************/
options center;
/* Close the listing output. */
ods listing close;
/* Use the DOCBOOK tagset to create output that conforms */
/* to the DocBook DTD by OASIS. */
/* You can specify the tagset a number of ways. */
/* Here we specify ods markup with the tagset option. */
/* Make sure you close the destination the same way you */
/* opened it. */
ods markup tagset=docbook body='odsmrk9a.xml';
ods markup tagset=docbook close;
/* Specify as tagsets.<tagset_name> */
/* Close it the same way. */
ods tagsets.docbook body='odsmrk9a.xml';
ods tagsets.docbook close;
/* Or simply specify just the tagset name. */
/* Close it the same way. */
ods docbook body='odsmrk9a.xml';
ods docbook close;
/* With DOCBOOK, you can create a body file. */
/* We will create this file. */
ods docbook body='odsmrk9a.xml';
proc format;
value regfmt 1='East' 2='West' 3='North' 4='South';
value habfmt 1='Urban' 2='Rural' 3='Burbs';
value sexfmt 1='Female' 2='Male';
run;
data one;
retain seed1 543 seed2 1234;
length region habitat sex x w1 y w2 8;
drop ind j;
do region = 1 to 4;
if region eq 2 or region eq 4 then
do habitat = 1 to 2;
do sex = 1 to 2;
call ranuni( seed1, ind );
ind = int( ind * 3 ) + 2;
if region=4 and sex=2 then ind=0;
do j= 1 to ind;
call rannor( seed2, y );
y = int( y * 3 + 13 );
x = 5 * y;
w1 = j;
w2 = 1+mod(j,2);
output;
end;
end;
end;
else
do habitat = 1 to 3;
do sex = 1 to 2;
call ranuni( seed1, ind );
ind = int( ind * 2 ) + 2;
do j= 1 to ind;
call rannor( seed2, y );
y = int( y * 3 + 13 );
x = 5 * y;
w1 = habitat;
w2 = sex;
output;
end;
end;
end;
end;
drop seed1 seed2;
format region regfmt. sex sexfmt. habitat habfmt.;
return;
run;
title2 'Proc print output to DOCBOOK';
proc print data=one;
where region in (2,4);
format sex 4. region 4.;
run;
data plants;
input type $ @;
do block=1 to 3;
input stemleng @;
output;
end;
cards;
clarion 32.7 32.3 31.5
clinton 32.1 29.7 29.1
knox 35.7 35.9 33.1
o'neill 36.0 34.2 31.2
compost 31.8 28.0 29.2
wabash 38.2 37.8 31.9
webster 32.5 31.1 29.7
;
run;
title2 'Proc GLM output to DOCBOOK';
proc glm data = plants;
class type block;
model stemleng=type block;
run;
quit;
/* Then close the DOCBOOK destination the same way it was */
/* opened. */
ods docbook close;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This code produces an XML file.
Click here to see the code
Results for this sample were generated in SAS Release 9.1.3 Service Pack 2.
This example demonstrates basic files generated from ODS MARKUP using DOCBOOK tagset.
| Type: | Sample |
| Topic: | Third Party ==> Output ==> XML SAS Reference ==> ODS (Output Delivery System)
|
| Date Modified: | 2005-09-17 03:02:56 |
| Date Created: | 2005-05-23 13:50:30 |
Operating System and Release Information
| SAS System | Base SAS | All | 9 TS M0 | n/a |