dependency injection - SAS Base Dataset as email body output -
i have 2 large sas datasets 65000 id's. want send 1 email ',' delimiter.
sasdatasetname.id_processed id 1 2 3 . . 65000 sasdatasetname.id_not_processed id b output in 1 email body needs number of id's processed=65000 1,2,3,4.. . . 65000 number of id's not processed=2 a,b
data b; length one_char $ 1; i=1 100000; one_char=byte(int(25*ranuni(0)+65)); *** return uppercase character; output; end; run; data b; length one_char $ 1; i=1 100000; one_char=byte(int(25*ranuni(0)+65)); *** give me uppercase character; output; end; run; data c; length one_char $ 1; i=1 100000; one_char=byte(int(25*ranuni(0)+65)); *** give me uppercase character; output; end; run; /*** assuming have smtp server available , sas configured use */ filename mymail email "your.name@somesite.com" subject="whatever you'd put in subject line"; data _null_; length concatenated $ 32676; retain _linelength 200; file mymail; if _n_ = 1 do; put 'hi there!' /; put; end; concatenated = ''; put / 'dataset b' /; while(not blast); set b end=blast; concatenated = strip(concatenated) || ',' || one_char; if length(concatenated) > _linelength or blast do; concatenated = substr(concatenated,2); put concatenated; concatenated=''; end; end; concatenated = ''; put / 'dataset c' /; while(not clast); set c end=clast; concatenated = strip(concatenated) || ',' || one_char; if length(concatenated) > _linelength or clast do; concatenated = substr(concatenated,2); put concatenated; concatenated=''; end; end; stop; run;
Comments
Post a Comment