BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10

How to make automate  code to send scheduling reports 

suppose i want to automate daily reports at the end of the day how delete yesterday date time stamp and

generate today date time stamp automatically can you anyone explain 

6 REPLIES 6
BrahmanandaRao
Lapis Lazuli | Level 10
Please tell me I don't know
Kurt_Bremser
Super User

Then you are asking the wrong question. To automate something, you need to have that something first.

Please supply example data in usable form, and an example for the report you want out of it, and show the code you already tried.

 

If you need someone to do all your work for you, hire someone.

LinusH
Tourmaline | Level 20

As @Kurt_Bremser says, you nee to tell/show us more.

  • SAs server or local machine
  • What scheduling options do you have at hand (internal SAS, external scduler)
  • How do you publish your report?
  • What format is your report in (html, pdf..)
  • What SAS producct do you have at hand?
Data never sleeps
BrahmanandaRao
Lapis Lazuli | Level 10
data tq84_rep;
input col_1 $ 1-11
col_2 $ 13-21
val_1 23-30;

datalines;
group one |foo | 42.10
group one |bar | 7.00
group one |baz | 5.99
group two |abc def | 18.1:2
group two |gh jklmno| 0.10
group three|pqr | 222.18
group three|stu vwx | 73.37
;
run;

ods html body = '‪C:\Users\Anand\Desktop\sasreport.htm';

proc report nowd data=tq84_rep

style(report ) = [background = green
cellspacing = 10
rules = rows
bordercolor = cxf03333
borderwidth = 3
frame = box /* above, below, box, hsides, vsides, lhs, rhs, void ??? */
]

style(column ) = [background = yellow
font_weight = bold /* medium, bold, light */
font_style = italic /* roman, italic */
]

style(header ) = [background = pink
font_size = 30px
font_face = Garamond
font_style = roman
cellheight = 100px /* ??? */
]

style(summary) = [background = lightblue
font_face ='Courier New'
font_width = wide /* compressed, narrow, wide */
]

style(lines ) = [background = cxD7EAFF
bordercolor = cxF03761
font =(Verdana, 4, bold italic)
]

style(calldef) = [background = purple ];

column col_1 col_2 val_1;

define col_1 / order 'Group';
define col_2 / display 'Text' ;
define val_1 / display 'Value';

break after col_1 / summarize;

%macro NOTHING;
compute after col_1;
/* Inside a compute block, call define statements can be used
to change style attributes */
if val_1.sum > 100 then
call define(
'val_1.sum', /* column id */
'style', /* attribute name style, url or format */
'style=[background=orange font_weight=bold]') /* value */
;

endcomp;
%mend;

/*
compute after col_1;
name = 'Total';
line ' ddd';
endcomp;
*/

run;

ods html close;
Kurt_Bremser
Super User

Always (as in ALWAYS) use a "code box" to post code. Open it with the "little running man" (next to the one indicated):

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

as the main posting window will destroy the horizontal positioning (among other things) of the data.

Next, a DATA step with DATALINES needs no RUN statement, as the DATALINES themselves constitute a step boundary.

The DATALINES block has to end with a line with a single semicolon at position 1 (or 4 semicolons in the case of DATALINES4). By using a RUN statement like you did, you force the DATA step to consider the word "run" as part of the data to be read.

Test your datalines code before posting here, as by fixing it on our own we might change the intended content of the dataset.

If you use a delimiter, use an INFILE DATALINES statement with the correct DLM= option, and omit fixed positions in the INPUT statement.

 

After close to 300 posts here on the communities, all this should be an easy exercise.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 942 views
  • 0 likes
  • 3 in conversation