Hello Experts,
I'm wondering how to create a file by name. For exemple, in this example we create the file for each name (with obj.open_dir(name: name, label: "", by: 1);
I would like to add the name on the pdf file like Carte_(name of student).pdf
Do you know please how to variate the name of pdf file by observation ?
title; ods listing close; ods html close; options nodate nonumber; ods escapechar="~"; options papersize=(15cm 10cm); options topmargin=0cm bottommargin=0cm leftmargin=0cm rightmargin=0cm; ods pdf file="Carte.pdf" notoc newfile=Bygroup;
data _null_; set sashelp.class; by name;
if _N_=1 then do; declare odsout obj(); end;
obj.open_dir(name: name, label: "", by: 1);
obj.layout_absolute(overrides: "borderwidth=1"); obj.region(width: "15cm", height: "2cm", overrides: "background=cx494068"); obj.format_text(data: "Groupe Scolaire L. Aragon", overrides: "color=cxbbb2e0 font_size=32pt", just: 'c');
Thank you !
Hi:
When you use NEWFILE=BYGROUP the behavior of ODS is to make numbered files, one increment for each by group value. If you want to do something that is data-driven so that the name of the student (or any other data driven value) is used in the FILE= option, you need to investigate using SAS macro variables and/or a SAS macro program. There have been examples of this posted in the past in the forums, so a search should help you find some of those examples.
Cynthia
Hi:
When you use NEWFILE=BYGROUP the behavior of ODS is to make numbered files, one increment for each by group value. If you want to do something that is data-driven so that the name of the student (or any other data driven value) is used in the FILE= option, you need to investigate using SAS macro variables and/or a SAS macro program. There have been examples of this posted in the past in the forums, so a search should help you find some of those examples.
Cynthia
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.