Prev: Re Spectral Analysis
Next: DDE not responding in SAS
From: N Shah on 23 Feb 2010 13:58 All, Art, Joe, Yu , Phil - Thank you all of you for your time. the put statement with double quote is the solution to my problem. I didn't put the quotes correctly first time around. Thank you so much. Shah On Tue, 23 Feb 2010 13:25:06 -0500, Arthur Tabachneck <art297(a)NETSCAPE.NET> wrote: >Are you sure you typed it correctly? The code worked as expected on my >machine (SAS9.13 on Windows server 2003). > >Art >-------- >On Tue, 23 Feb 2010 11:32:00 -0500, N Shah <nshah6(a)LUC.EDU> wrote: > >>Nope , it didn't work. I tired what you suggested below, but it results >into >>an error b/c put statement doesn't recognize double quotes within double >quotes. >> >>Put statement will take literal value in double quotes. so, "title" never >>resolves to actual file name and "number" never resolves to actual record >count. >> >>I think only option left is instead of making macro variable, as suggested >>by Phil, I just use the value as it is. But I will not be able to format >the >>values as "Bold" and "Underline" in my email message . >> >>So my Put statement will be more like" >> >>Put " The file name is = " title ; >>Put " The record count is = " number; >> >>I am still open to suggestion. Again, I am thankful for your detail >response. >> >>sincerely, >>Shah >> >>On Mon, 22 Feb 2010 18:40:17 -0500, Arthur Tabachneck ><art297(a)NETSCAPE.NET> >>wrote: >> >>>Then, couldn't you do it with something like: >>> >>>data _null_; >>> length title number $40 ; >>> infile readin end=eof; >>> input number title; >>> call symput('count',number); >>> call symput('name',title); %put _user_ ; >>> file output; >>> put "<font face-'Calibri' size=3.5> This <b>" title >>> "</b> has <u> " number " </u></font> records"; >>>run; >>> >>>Art >>>------- >>>On Mon, 22 Feb 2010 18:05:27 -0500, N Shah <nshah6(a)LUC.EDU> wrote: >>> >>>>Art, >>>> >>>>In order not to complicate matter, I put only part of code that I see >the >>>>problem. >>>> >>>>My end goal is to format the output file and send it as an email. >>>> >>>>The output file that I am showing in the example is not going to be HTML >>>but >>>>will be used as email message . so my output statement will be >>>> >>>>filename Output email ......; >>>> >>>>The message that I want in body of the email need to be formatted. that >is >>>>"Title" and "Number" >>>> >>>>so I want my %put statement to look like, >>>> >>>>%put "<font face-'Calibri' size=3.5> This <b> &name </b> has <u> &count >>></u> >>>></font> records" >>>> >>>>since I am reading the file in data _null_ statement , I need to either >>>read >>>>"Number" and "Title" columns as macro variable or convert both to macro >>>>variable. >>>> >>>>so that when I use %put statement it resolves the variables correctly >and >>>>format accordingly. >>>> >>>>I hope it make sense. I also apologies for not providing enough >>>information >>>>first time around. >>>> >>>> >>>>On Mon, 22 Feb 2010 17:47:03 -0500, Arthur Tabachneck >>><art297(a)NETSCAPE.NET> >>>>wrote: >>>> >>>>>As Yu mentioned you can access it with symget. But, why would you need >>>to >>>>>access it in the same data step when you already have direct access to >>>the >>>>>variable on which it is based? >>>>> >>>>>Just wondering, >>>>>Art >>>>>------- >>>>>On Mon, 22 Feb 2010 16:37:59 -0500, N Shah <nshah6(a)LUC.EDU> wrote: >>>>> >>>>>>But what if I need to resolve the Macro variables in the same Data >>>step ? >>>>>> >>>>>>is it even possible ? >>>>>> >>>>>>Thank you ! >>>> >>>>Thank you for your response in advance. >>>> >>>>filename readin "~/test/test.txt"; filrname output "~/test/test.html"; >>>> >>>>data _null_; length title number $40 ; infile readin end=eof; input >number >>>>title; call symput('count',number); call symput('name',title); %put >>>_user_ ; >>>>file output; %put "This &name has &count records" ; run; >>>> >>>>What is wrong in above code ? I am getting an error that "Apparent >>>symbolic >>>>reference NAME/Number not resolved." >>>> >>>>For testing purpose, there is one record in the file with below values: >>>>Title Number 1. Test.txt 100 >>>> >>>>I appreciate your time |