BookmarkSubscribeRSS Feed
a_ramos
Obsidian | Level 7

/* Table with email and names */
DATA NAMES;
INFILE DATALINES DELIMITER='|';
FORMAT EMAIL $CHAR23. NAME $CHAR5. CODE $CHAR10.;
INPUT EMAIL $ NAME $ CODE $;
DATALINES;
email.1@test.com|Name1|1111, 2020
email.2@test.com|Name2|1000, 2026
email.3@test.com|Name3|1008, 2096
;

/* Emails that will be sent in copy */
PROC SQL NOPRINT;
SELECT DISTINCT CAT('"',TRIM(EMAIL),'"') INTO: LISTA SEPARATED BY ' ' FROM NAMES;
QUIT;

/* Email */
%LET DIA=%SYSFUNC(TODAY());
%LET NDIA=%SYSFUNC(INTNX(DAY,&DIA,-1,B),DDMMYY10.);

FILENAME REPORT ".../REPORT.html";
FILENAME CODE
EMAIL "email@test.com"
CC=(&LISTA)
CONTENT_TYPE="text/html"
SUBJECT="Title &NDIA."
ATTACH=(".../archive.xlsx" CONTENT_TYPE="application/xlsx");

/* HTML Report File */
ODS HTML FILE=REPORT;
ODS NOPTITLE NOPROCTITLE;

PROC REPORT DATA=NAMES(DROP=EMAIL) NOWD HEADLINE HEADSKIP
STYLE (REPORT) = {BACKGROUND = WHITE FONT_SIZE = 8PT
FONT_FACE = "Calibri" FONT_SIZE = 9PT JUST=LEFT}

STYLE (COLUMN) = {BACKGROUND = WHITE CELLHEIGHT = 3.5%
FONT_FACE = "Calibri" FONT_SIZE = 9PT JUST=LEFT}

STYLE (HEADER) = {FOREGROUND = CXFF8C00 FONT_FACE="Calibri"
FONT_SIZE = 10PT JUST=LEFT
BACKGROUND = WHITE} ;
RUN;

ODS HTML CLOSE;

/* HTML edited for me */
FILENAME ETL '.../ETL.html';

/* Incorrect */
DATA _NULL_;
INFILE ETL;
FILE ETL2;
INPUT;
PUT _INFILE_;

INFILE REPORT;
FILE ETL2;
INPUT;
PUT _INFILE_;
RUN;

 

It is something like concatenating files. But the files are in HTML.
Basically, I want to include a few lines from one HTML file to another while keeping your writing

1 REPLY 1

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 551 views
  • 0 likes
  • 2 in conversation