Ce programme crée un jeu de données contenant des chaînes de caractères avec des balises de formatage (superscript, subscript). Il configure ensuite plusieurs destinations ODS (HTML, Excel, RTF, PDF) et définit un caractère d'échappement (^) pour interpréter ces balises. Il utilise PROC PRINT pour afficher les données avec des titres et des notes de bas de page formatés.
Analyse des données
Type : CREATION_INTERNE
Les données sont générées directement dans le Data Step 'sup_sub'.
1 Bloc de code
DATA STEP Data
Explication : Création de la table 'sup_sub' contenant des exemples de textes avec des balises de formatage ODS (ex: ^{super 2}, ^{sub 8}).
Copié !
data sup_sub;
length myvar $200;
myvar = "Pythagorean Theorem: a^{super 2} + b^{super 2} = c^{super 2}";
output;
myvar = "This is something that needs a footnote. ^{super 1}";
output;
myvar = "Macbeth: 'Is this a dagger I see before me?' ^{dagger}";
output;
myvar = "The Caffeine molecule is an alkaloid of the methylxanthine family: " ||
"C^{sub 8}H^{sub 10}N^{sub 4}O^{sub 2}";
output;
run;
myvar = "This is something that needs a footnote. ^{super 1}";
6
OUTPUT;
7
myvar = "Macbeth: 'Is this a dagger I see before me?' ^{dagger}";
8
OUTPUT;
9
myvar = "The Caffeine molecule is an alkaloid of the methylxanthine family: " ||
10
"C^{sub 8}H^{sub 10}N^{sub 4}O^{sub 2}";
11
OUTPUT;
12
RUN;
2 Bloc de code
PROC PRINT
Explication : Configuration des sorties ODS et du caractère d'échappement '^'. Définition de notes de bas de page complexes utilisant ce caractère pour le formatage. Exécution de PROC PRINT pour générer le rapport dans les fichiers spécifiés.
Copié !
ods html file='inline2.html' style=sasweb;
ods html3 file='inline2.xls' style=sasweb;
ods rtf file='inline2.rtf' notoc_data;
ods pdf file='inline2.pdf';
ods escapechar='^';
footnote1 j=l "Note. Data include persons with a diagnosis of HIV infection regardless of stage of disease at diagnosis.";
footnote2 j=l "^{super a}Estimated numbers resulted from statistical adjustment that accounted for reporting delays and missing risk-factor information, but not for incomplete reporting. Rates are per 100,000 population. Rates are not calculated by transmission category because of the lack of denominator data.";
footnote3 j=l "^{super b}Hispanics/Latinos can be of any race.";
footnote4 j=l "^{super c}Heterosexual contact with a person known to have, or to be at high risk for, HIV infection. ";
footnote5 j=l "^{super d}Includes hemophilia, blood transfusion, perinatal exposure, and risk factor not reported or not identified. ";
footnote6 j=l "^{super e}Includes hemophilia, blood transfusion, and risk factor not reported or not identified. ";
footnote7 j=l "^{super f}Because column totals for estimated numbers were calculated independently of the values for the subpopulations, the values in each column may not sum to the column total.";
proc print data=sup_sub;
title j=r 'PDF & RTF: Page ^{thispage} of ^{lastpage}';
title2 j=c 'RTF only: ^{pageof}';
run;
ods _all_ close;
1
ods html file='inline2.html' style=sasweb;
2
ods html3 file='inline2.xls' style=sasweb;
3
ods rtf file='inline2.rtf' notoc_data;
4
ods pdf file='inline2.pdf';
5
6
ods escapechar='^';
7
8
footnote1 j=l "Note. Data include persons with a diagnosis of HIV infection regardless of stage of disease at diagnosis.";
9
footnote2 j=l "^{super a}Estimated numbers resulted from statistical adjustment that accounted for reporting delays and missing risk-factor information, but not for incomplete reporting. Rates are per 100,000 population. Rates are not calculated by transmission category because of the lack of denominator data.";
10
footnote3 j=l "^{super b}Hispanics/Latinos can be of any race.";
11
footnote4 j=l "^{super c}Heterosexual contact with a person known to have, or to be at high risk for, HIV infection. ";
12
footnote5 j=l "^{super d}Includes hemophilia, blood transfusion, perinatal exposure, and risk factor not reported or not identified. ";
13
footnote6 j=l "^{super e}Includes hemophilia, blood transfusion, and risk factor not reported or not identified. ";
14
footnote7 j=l "^{super f}Because column totals for estimated numbers were calculated independently of the values for the subpopulations, the values in each column may not sum to the column total.";
15
16
PROC PRINTDATA=sup_sub;
17
title j=r 'PDF & RTF: Page ^{thispage} of ^{lastpage}';
18
title2 j=c 'RTF only: ^{pageof}';
19
RUN;
20
21
ods _all_ close;
Ce matériel est fourni "tel quel" par We Are Cas. Il n'y a aucune garantie, expresse ou implicite, quant à la qualité marchande ou à l'adéquation à un usage particulier concernant le matériel ou le code contenu dans les présentes. We Are Cas n'est pas responsable des erreurs dans ce matériel tel qu'il existe maintenant ou existera, et We Are Cas ne fournit pas de support technique pour celui-ci.
SAS et tous les autres noms de produits ou de services de SAS Institute Inc. sont des marques déposées ou des marques de commerce de SAS Institute Inc. aux États-Unis et dans d'autres pays. ® indique un enregistrement aux États-Unis. WeAreCAS est un site communautaire indépendant et n'est pas affilié à SAS Institute Inc.
Ce site utilise des cookies techniques et analytiques pour améliorer votre expérience.
En savoir plus.