[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: table gridline question, ODS/pdf
From:       "Delaney, Kevin P." <khd8 () CDC ! GOV>
Date:       2003-07-31 17:15:51
[Download RAW message or body]

Chenwei,

Not sure what you want based on the picture, It looks like you want to
separate the header from the data rows of the report, and then maybe put
column separators for some columns but not all, and no row separators??

It's not easy (it may be impossible) to add column separtors between certain
columns in SAS using ODS , but you can have NO separators and do what you
want by adding a couple dummy columns in Proc Report:

proc template;
define style forChenWei / store = SASUSER.TEMPLAT;
      parent = styles.default;

      replace color_list /

         'link' = blue

         'bgH' = white

         'fg' = black

         'bg' = white;

      replace colors

         "Abstract colors used in the default style" /

         'headerfgemph' = color_list('fg')

         'headerbgemph' = color_list('bgH')

         'headerfgstrong' = color_list('fg')

         'headerbgstrong' = color_list('bgH')

         'headerfg' = color_list('fg')

         'headerbg' = color_list('bgH')

         'datafgemph' = color_list('fg')

         'databgemph' = color_list('bg')

         'datafgstrong' = color_list('fg')

         'databgstrong' = color_list('bg')

         'datafg' = color_list('fg')

         'databg' = color_list('bg')

         'batchbg' = color_list('bg')

         'batchfg' = color_list('fg')

         'tableborder' = color_list('fg')

         'tablebg' = color_list('fg')

         'notefg' = color_list('fg')

         'notebg' = color_list('bg')

         'bylinefg' = color_list('fg')

         'bylinebg' = color_list('bg')

         'bylinebg' = color_list('bg')

         'captionfg' = color_list('fg')

         'captionbg' = color_list('bg')

         'proctitlefg' = color_list('fg')

         'proctitlebg' = color_list('bg')

         'titlefg' = color_list('fg')

         'titlebg' = color_list('bg')

         'systitlefg' = color_list('fg')

         'systitlebg' = color_list('bg')

         'Conentryfg' = color_list('fg')

         'Confolderfg' = color_list('fg')

         'Contitlefg' = color_list('fg')

         'link2' = color_list('link')

         'link1' = color_list('link')

         'contentfg' = color_list('fg')

         'contentbg' = color_list('bg')

         'docfg' = color_list('fg')

         'docbg' = color_list('bg');

      style titleAndNoteContainer from titleAndNoteContainer /

         outputwidth = _undef_;

      replace table /

         rules = groups

         frame = box

         cellspacing = 0

         cellpadding = 2pt
                  ;
      style batch from batch /

         rules = none

         frame = void

         cellpadding = 0pt

         cellspacing = 0pt;

      replace Body from Document

         "Controls the Body file." /

         bottommargin = 0.25in

         topmargin = 0.25in

         rightmargin = 0.25in

         leftmargin = 0.25in;

      replace cell from container /

         linkcolor = colors('link2');

      replace headersAndFooters from cell /

         font = fonts('HeadingFont')

         foreground = colors('headerfg')

         background = white;

   end;

run;



ods PDF file="C:\temp\chenwei.pdf" style=forchenwei;
proc report data=sashelp.class nowd;
columns Name sep1 Sex sep2 Age height weight;
define Name /display ;
define sep1/computed  " " style(column)={Foreground=Black Background=black};
define Sex /display ;
define sep2/computed " " style(column)={Foreground=Black Background=black};
define Age /display ;
define height/display;
define weight/display;
compute sep1 /char length=1;
sep1=" ";
endcomp;
compute sep2/char length=1;
sep2=" ";
endcomp;

run;
ods pdf close;


You would think by drawing us a picture we would know exactly what you want,
but maybe programmers aren't visual people??

If you want to do this for some output other than Proc Report, I am not sure
how you could get the look I put together above, and if you wanted something
else and I guessed wrong, reply to the list and we'll see what we can do...

Always happy to help out a fellow Colonial....

Kevin
Kdelaney@cdc.gov
GWU-CCAS 1998


-----Original Message-----
From: Chenwei Liu [mailto:CLiu@BIOSTAT.BSC.GWU.EDU]
Sent: Thursday, July 31, 2003 11:23 AM
Subject: table gridline question, ODS/pdf


Hi all,

I am trying to create a report like the following draft,
need some grid lines, but not all.  I did the frame=box style, but don't
know how to control the frame or rule of a cell. Is it possible to control
the frame or rule of a cell or row in SAS version 8.2?

Thanks in advance.


Chenwei



       _______________________________________________
      | All | Center1   Center2   ...                |
      |     |                                        |
  ____________________________________________________
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
_____________________________________________________












At 10:15 AM 7/31/03 -0400, you wrote:


> 
> SAS-L Digest - 31 Jul 2003 - Special issue (#2003-993)
> 
> 
> 
> 
> 
> Table of contents:
> 
> * looking for sas job in FL (2)
> * Cashwon is Now up and running
> * <No subject given>
> * setting variable value based on value of another variable
> * Where and Contains (2)
> * strange result from in:
> * SAS/MVS: Delete x previous records based on condition
> * [variable lookup]
> * &Region in macro does not resolve correctly...
> * Index Descending?
> * looking for sas job in FL
> * <cid:131098@LISTSERV.UGA.EDU>looking for sas job in FL
> * From: Jmyong2002@AOL.COM
> * <cid:131102@LISTSERV.UGA.EDU>Re: looking for sas job in FL
> * From: Charles Patridge <charles_s_patridge@PRODIGY.NET>
> * Cashwon is Now up and running
> * <cid:131099@LISTSERV.UGA.EDU>Cashwon is Now up and running
> * From: "Cashwon.com" <winners@CASHWON.COM>
> * <No subject given>
> * <cid:131100@LISTSERV.UGA.EDU><No subject given>
> * From: "Crawley-Boevey, Richard RM" <RMCrawley-Boevey@SBIC.CO.ZA>
> * setting variable value based on value of another variable
> * <cid:131101@LISTSERV.UGA.EDU>Re: setting variable value based
> on value of another variable
> * From: "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
> * Where and Contains
> * <cid:131103@LISTSERV.UGA.EDU>Where and Contains
> * From: Susie Li <Susie.Li@US.SANOFI.COM>
> * <cid:131107@LISTSERV.UGA.EDU>Re: Where and Contains
> * From: "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
> * strange result from in:
> * <cid:131104@LISTSERV.UGA.EDU>Re: strange result from in:
> * From: Ian Whitlock <WHITLOI1@WESTAT.COM>
> * SAS/MVS: Delete x previous records based on condition
> * <cid:131105@LISTSERV.UGA.EDU>Re: SAS/MVS: Delete x previous
> records based on condition
> * From: Kumar <kamur@LYCOS.COM>
> * [variable lookup]
> * <cid:131106@LISTSERV.UGA.EDU>Re: [variable lookup]
> * From: Magnus Mengelbier <magnus.mengelbier@FERRING.COM>
> * &Region in macro does not resolve correctly...
> * <cid:131108@LISTSERV.UGA.EDU>Re: &Region in macro does not
> resolve correctly...
> * From: Rey <j-santos@TAMU.EDU>
> * Index Descending?
> * <cid:131109@LISTSERV.UGA.EDU>Re: Index Descending?
> * From: Ian Whitlock <WHITLOI1@WESTAT.COM>
> 
> 
> ----------
> Browse the <http://listserv.uga.edu/cgi-bin/wa?LIST=SAS-L>SAS-L online
> archives.
> Date:    Thu, 31 Jul 2003 08:29:28 EDT
> From:    Jmyong2002@AOL.COM
> Subject: looking for sas job in FL
> MIME-Version: 1.0
> Content-Type: text/plain; charset="US-ASCII"
> Content-Transfer-Encoding: 7bit
> 
> Hi, everyone,
> 
> Anybody has information about sas jobs in Florida? (Orlando or Tampa
> are most preferred places). I really appreciate if you could help me on
> that!
> 
> Best wishes and I am looking forward to hearing from you.
> 
> JM
> Date:    Thu, 31 Jul 2003 05:40:48 -0700
> From:    "Cashwon.com" <winners@CASHWON.COM>
> Subject: Cashwon is Now up and running
> 
> Visit http://www.cashwon.com and sign up.  Cashwon is an all service
> search portalthat allows you to win and earn money for doing what you
> all ready do online.
> 
> Visit http://www.cashwon.com/winners.php to seeif you are a winner.
> 
> Daily Prizes- $250 cash
> WeeKly Prizes- $1,000 cash
> Monthly Prizes- $2,500 cash
> 
> Annual Grand Prize- BMW X5 plus $25,000
> 
> http://www.cashwon.com has numerous sponsored prizes in addition to all
> cash givaways. Please visit http://www.cashwon.com where everyone is a
> winner.
> 
> 
> You are receiving this email because you registered at CashWon and
> agreed to receive  email from us regarding new features, events and
> special offers about Ca$hwon services.
> 
> If you wish to be unsubscribed from receiving these
> emails, please respond to remove@cashwon.com
> 
> Thank You For Your Loyalty
> The Cashwon Family
> 
> http://www.cashwon.com
> Date:    Thu, 31 Jul 2003 14:05:15 +0200
> From:    "Crawley-Boevey, Richard RM" <RMCrawley-Boevey@SBIC.CO.ZA>
> Subject: <No subject given>
> MIME-Version: 1.0
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi
> 
> I have a problem that I have solved using several data steps and PROC
> SQL. But I am sure that there is a much easier way of doing what I
> want.
> 
> DATA Temp;
> Input Var200203 Var200204 Var200205 VarLookUp $11.;
> DataLines;
> 1 2 3 Var200203
> 5 6 7 Var200204
> 3 6 9 Var200205
> ;
> RUN;
> 
> I am trying to code a variable (VarOut) that would look for the value
> in the appropiate column. In other words it must look for the value in
> VarLookUp and then go to that column and extract the
> appropiate value for it's row. Please bear in mind that I have just over 70
> 000 records and a slow PC :)
> 
> The output should look something like:
> 
> Var200203 Var200204 Var200205 VarLookUp VarOut
> 1         2         3         Var200203 1
> 5         6         7         Var200204 6
> 3         6         9         Var200205 9
> 
> Thanks in advance
> Richard Crawley-Boevey
> 
> 
> _______________________________________________________________________
> _________
> __________________________________________________
> 
> For information about the Standard Bank group visit our web site
> <www.standardbank.co.za>
> _______________________________________________________________________
> _________
> __________________________________________________
> 
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relating to the official
> business
> of Standard Bank Group Limited  is proprietary to the group. It is
> confidential, legally privileged and protected by law. Standard Bank
> does not own and endorse any other content. Views and opinions are
> those of the sender unless clearly stated as being that of the group.
> The person addressed in the e-mail is the sole authorised recipient. Please
> notify the sender immediately if it has unintentionally reached you and
> do not
> read,
> disclose or use the content in any way.
> Standard Bank can not assure that the integrity of this communication has
been
> maintained nor that it is free of errors, virus, interception or
> interference.
> ___________________________________________________________________________
_____
> ___________________________________________________
> Date:    Thu, 31 Jul 2003 09:02:59 -0400
> From:    "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
> Subject: Re: setting variable value based on value of another variable
> MIME-Version: 1.0
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Subject lines are good, please use 'em.
> 
> While the vname function is comparatively expensive, it's helpful here.
> One additional data line added to test with unexpected data.
> 
> DATA Temp;
> Input Var200203 Var200204 Var200205 VarLookUp $11.;
> DataLines;
> 1 2 3 Var200203
> 5 6 7 Var200204
> 3 6 9 Var200205
> 3 6 9 Var200206
> ;
> 
> data done ( drop = _: );
> set temp;
> array vars var2: ;
> do _i = 1 to dim(vars) until (vname(vars(_i)) = varlookup) ;
> end;
> if _i le dim(vars) then varout = vars(_i);
> run;
> 
> proc print data=done;
> run;
> 
> -----Original Message-----
> From:   Crawley-Boevey, Richard RM
> [mailto:RMCrawley-Boevey@SBIC.CO.ZA]
> Sent:   Thursday, July 31, 2003 8:05 AM
> To:     SAS-L@LISTSERV.UGA.EDU
> Subject:
> 
> Hi
> 
> I have a problem that I have solved using several data
> steps and PROC SQL.
> But I am sure that there
> is a much easier way of doing what I want.
> 
> DATA Temp;
> Input Var200203 Var200204 Var200205 VarLookUp $11.;
> DataLines;
> 1 2 3 Var200203
> 5 6 7 Var200204
> 3 6 9 Var200205
> ;
> RUN;
> 
> I am trying to code a variable (VarOut) that would
> look for the value in the
> appropiate column.
> In other words it must look for the value in VarLookUp
> and then go to that
> column and extract the
> appropiate value for it's row. Please bear in mind
> that I have just over 70
> 000 records and a slow PC :)
> 
> The output should look something like:
> 
> Var200203 Var200204 Var200205 VarLookUp VarOut
> 1         2         3         Var200203 1
> 5         6         7         Var200204 6
> 3         6         9         Var200205 9
> 
> Thanks in advance
> Richard Crawley-Boevey
> 
> 
> 
> _______________________________________________________________________
> _____
> ______________________________________________________
> 
> For information about the Standard Bank group visit
> our web site <www.standardbank.co.za>
> 
> _______________________________________________________________________
> _____
> ______________________________________________________
> 
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relating
> to the official business of Standard Bank Group Limited  is proprietary
> to the group.
> It is confidential, legally privileged and protected by
law.
> Standard Bank does not own and endorse any other
> content. Views and opinions are those of the sender unless clearly
> stated as being that of the group.
> The person addressed in the e-mail is the sole
> authorised recipient. Please notify the sender immediately if it has
> unintentionally reached you and do not read,
> disclose or use the content in any way.
> Standard Bank can not assure that the integrity of
> this communication has been maintained nor that it is free of errors,
> virus, interception or interference.
> 
> _______________________________________________________________________
> _____
> _______________________________________________________
> Date:    Thu, 31 Jul 2003 09:08:26 -0400
> From:    Charles Patridge <charles_s_patridge@PRODIGY.NET>
> Subject: Re: looking for sas job in FL
> 
> Dear JM,
> 
> If you are unemployed, SCONSIG.com is happy to post your resume on its
> site to help you attract possible SAS openings.  And if you select to
> seek jobs only in Florida, you could state that in your career
> objectives so companies/agencies would know that by reading your
> resume.
> 
> The cost is free for unemployed SAS professionals.  Otherwise, I charge
> a whopping $12 for 1 year of posting your resume.
> 
> HTH and good luck.
> Charles Patridge
> 
> PS, I do have job postings that go back to January 1997 so you could
> peruse these listings for jobs in Florida and see if these
> companies/agencies may have a need for someone like yourself for current
openings.
> Date:    Thu, 31 Jul 2003 09:32:02 -0400
> From:    Susie Li <Susie.Li@US.SANOFI.COM>
> Subject: Where and Contains
> MIME-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> 
> I do a lot of string searches  based on partial information as in the
> following example.  This is as close to the SQL wild-card search as I
> get in SAS, by using "Where" and "Contains" together.
> 
> It is okay for checking one or two records this way, but gets rather
> cumbersome if I have to do many searches, since I have to type the
> "contains" text strings by hand one by one.  Is there an easier way to
> accomplish this by supplying a file instead?
> 
> 
> 
> data found;
> set demo;
> where ((lname contains (upcase('baljep'))) and (fname contains
> (upcase
> ('raj')))) or
> ((lname contains (upcase('chawla'))) and (fname contains
(upcase
> ('rajesh')));
> LFname=substr(lname,1,10)||'/'||substr(fname,1,10);
> 
> proc print;
> var LFname;
> run;
> 
> 
> 
> 
> Susie Li
> Sanofi-Synthelabo, Inc.
> 90 Park Ave
> New York, NY 10016
> (212)551-4385
> susie.li@us.sanofi.com
> 
> 
> Important:  The Information in this e-mail belongs to Sanofi-Synthelabo
> Inc., is intended for the use of the individual or entity to which it
> is addressed, and may contain information that is privileged,
> confidential, or exempt from disclosure under applicable law.  If you
> are not the intended recipient, you are hereby notified that any
> disclosure, copying, distribution, or use of, or reliance on, the
> contents of this e-mail is prohibited.  If you have received this
> e-mail in error, please notify us immediately by replying back to the
sending e-mail address, and delete this e-mail message from your computer.
> Date:    Thu, 31 Jul 2003 09:28:19 -0400
> From:    Ian Whitlock <WHITLOI1@WESTAT.COM>
> Subject: Re: strange result from in:
> MIME-Version: 1.0
> Content-Type: text/plain
> 
> Jack,
> 
> As Stig and Jeff have pointed out, there seems to be something
> different about the way equality: and in: testing are done.  Following
> Howard's suggestion
> 
> 6    data _null_ ;
> 7       var1 = "  " ;
> 8       if substr(compress(var1),1,1) in: ('>1', '<1') then flag=1;
> 9       put flag= ;
> 10   run ;
> 
> NOTE: Invalid third argument to function SUBSTR at line 8 column 7.
> flag=1 var1=  flag=1 _ERROR_=1 _N_=1
> NOTE: DATA statement used:
> real time           0.04 seconds
> cpu time            0.01 seconds
> 
> We see that in fact the COMPRESS(VAR1) is treated as having a length 0
> within the SUBSTR processing under the assumption that the NOTE is
> accurate. This appears to back up your explanation.
> 
> On the other hand,
> 
> 16   data _null_ ;
> 17      var1 = "  " ;
> 18      if compress(var1) =: '>1' then flag=1;
> 19      put flag= ;
> 20   run ;
> 
> flag=.
> NOTE: DATA statement used:
> real time           0.03 seconds
> cpu time            0.00 seconds
> 
> appears to suggest that the compressed length cannot be 0, precisely
> because of your argument.
> 
> Now I don't really care whether the results are true or false, but I do
> wish the handling of the length of COMPRESS(VAR1) was consistent across
> the system.  Can someone give a reasonable argument that my conclusion
> of inconsistency is wrong, because I find it easier to fix my thoughts
> that to fix SAS.
> 
> IanWhitlock@westat.com
> 
> -----Original Message-----
> From: Jack Hamilton [mailto:JackHamilton@FIRSTHEALTH.COM]
> Sent: Wednesday, July 30, 2003 5:00 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: strange result from in:
> 
> 
> The truncated comparison modifier tells SAS to compare two strings
> using the length of the shorter string.  The length of a blank string
> is 0, so anything compared to it will be truncated to length 0 for the
> truncated comparison.  '' and '' compare equal, so the expression is
> true.
> 
> 
> 
> 
> 
> 
> --
> JackHamilton@FirstHealth.com
> Manager, Technical Development
> Metrics Department, First Health
> West Sacramento, California USA
> 
> > > > "Ling Yun Chen" <lchen@RHOWORLD.COM> 07/30/2003 1:41 PM >>>
> Dear SAS-Lers, I just ran into a strange problem and I can't figure out
> why it happened.  Here's the code,
> 
> if compress(var1) in: ('>1', '<1') then flag=1;
> 
> What I don't understand is why when var1 is blank, the record is
> flagged with flag=1.  Does anybody know why this happened? Thanks.
> 
> Ling
> Date:    Thu, 31 Jul 2003 06:50:37 -0700
> From:    Kumar <kamur@LYCOS.COM>
> Subject: Re: SAS/MVS: Delete x previous records based on condition
> MIME-Version: 1.0
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 8bit
> 
> Hi Paul,
> 
> Thanks for the code...I am not sure if it is doing what I was
> expectting... I wanted to delete SUMMARY record and 2 records just
> above that SUMMARY line!
> 
> Kind regards
> Kamur
> 
> 
> 
> 
> paul_dorfman@HOTMAIL.COM (Paul Dorfman) wrote in message
> news:<BAY2-F124R6sKBEr8pk0000f12b@hotmail.com>...
> > Kamur,
> > 
> > That is the kind of work cut right for the DoW-loop:
> > 
> > data _null_ ;
> > infile IN    ;
> > file   OUT ;
> > do until ( upcase(_infile_) =: 'RECORD' ) ;
> > input ;
> > if input (_infile_, ?? 1.) eq . and upcase(_infile_) ne: 'S'
> then put
> > _infile_ ;
> > end ;
> > run ;
> > 
> > Kind regards,
> > ===============> > Paul M. Dorfman
> > Jacksonville, FL
> > ===============> >
> > 
> > > From: Kumar <kamur@LYCOS.COM>
> > > 
> > > Hello,
> > > 
> > > My input file has layout like:
> > > 
> > > Code:
> > > 
> > > 
> > > Record1AAAAAAAAAAAAAAAAAAA
> > > BBBBBBBBBBBBBBBBBBBBBBBBB
> > > CCCCCCCCCCCCCCCCCCCCCC
> > > DDDDDDDDDDDDDDDDDDDDDD
> > > 1111111111111111111111111111
> > > 2222222222222222222222222222
> > > SUMMARYXXXXXXXXXXXXXXXXX
> > > Record2AAAAAAAAAAAAAAAAAAA
> > > BBBBBBBBBBBBBBBBBBBBBBBBB
> > > CCCCCCCCCCCCCCCCCCCCCC
> > > DDDDDDDDDDDDDDDDDDDDDD
> > > 3333333333333333333333333333
> > > 5555555555555555555555555555
> > > SUMMARYXXXXXXXXXXXXXXXXX
> > > Record3AAAAAAAAAAAAAAAAAAA
> > > BBBBBBBBBBBBBBBBBBBBBBBBB
> > > CCCCCCCCCCCCCCCCCCCCCC
> > > DDDDDDDDDDDDDDDDDDDDDD
> > > 4444444444444441111111111111
> > > 7799999999999999222222222222
> > > SUMMARYXXXXXXXXXXXXXXXXX
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Here, lets say these are records for 3 transactions, identified by
> > > Record1, Record2 and Record3. As the last record of each of this
> > > transaction, there is a SUMMARY record.
> > > The Summary records in actual, includes the SUMMARY line and 2 records
> > > above this line (the numeric records in this sample).
> > > 
> > > I need to conditionally see if the record is SUMMARY line and if
> > > so, need to delete the SUMMARY line and 2 records above it.
> > > 
> > > So my output file will look like:
> > > 
> > > Code:
> > > 
> > > 
> > > Record1AAAAAAAAAAAAAAAAAAA
> > > BBBBBBBBBBBBBBBBBBBBBBBBB
> > > CCCCCCCCCCCCCCCCCCCCCC
> > > DDDDDDDDDDDDDDDDDDDDDD
> > > Record2AAAAAAAAAAAAAAAAAAA
> > > BBBBBBBBBBBBBBBBBBBBBBBBB
> > > CCCCCCCCCCCCCCCCCCCCCC
> > > DDDDDDDDDDDDDDDDDDDDDD
> > > Record3AAAAAAAAAAAAAAAAAAA
> > > BBBBBBBBBBBBBBBBBBBBBBBBB
> > > CCCCCCCCCCCCCCCCCCCCCC
> > > DDDDDDDDDDDDDDDDDDDDDD
> > > 
> > > 
> > > 
> > > 
> > > How can I achieve this with SAS/MVS program?
> > > 
> > > Regards
> > > Kamur
> > 
> > _________________________________________________________________
> > Tired of spam? Get advanced junk mail protection with MSN 8.
> > http://join.msn.com/?pageşatures/junkmail
> Date:    Thu, 31 Jul 2003 15:10:08 +0200
> From:    Magnus Mengelbier <magnus.mengelbier@FERRING.COM>
> Subject: Re: [variable lookup]
> 
> Hello Richard
> 
> Maybe a different approach using a transpose but it works quite well. I
> have come across your set-up a few times with only the VarLookUp as
> known and consistently available.
> 
> HTH
> 
> Magnus
> 
> 
> <code>
> 
> DATA Temp;
> N = _n_;  /* <-- create a temporary row index -- */
> Input Var200203 Var200204 Var200205 VarLookUp $11.;
> DataLines;
> 1 2 3 Var200203
> 5 6 7 Var200204
> 3 6 9 Var200205
> ;
> RUN;
> 
> 
> proc sort data=temp;  by n varlookup; run;
> 
> proc transpose data=work.temp  out=tmp1(rename=(col1=VarOut));
> by n varlookup;
> run;
> 
> proc sql noprint;
> create table out as
> select a.*,
> b.VarOut
> from work.temp a left join work.tmp1 b
> on (a.n = b.n)
> where (upcase(trim(left(a.VarLookup))) >upcase(trim(left(b._name_)))); quit;
> 
> 
> 
> </code>
> 
> 
> -----------------------------------------------------------------------
> -----
> ---
> Magnus Mengelbier                          e-mail
> magnus.mengelbier@ferring.com
> Statistical programmer                     direct +45 28 78 74 15
> Kay Fiskers Plads 11                       main +45 88 33 88 34
> 2300 Copenhagen S                          fax +45 28 17 64 15
> Denmark
> 
> 
> 
> 
> -----Original Message-----
> From: Crawley-Boevey, Richard RM [mailto:RMCrawley-Boevey@SBIC.CO.ZA]
> Sent: 31 July 2003 14:05
> To: SAS-L@AKH-Wien.AC.AT
> Subject:
> 
> 
> This message is in MIME format. Since your mail reader does not
> understand this format, some or all of this message may not be legible.
> 
> ------_=_NextPart_001_01C3575B.AC8E5DAC
> Content-Type: text/plain;
> charset="iso-8859-1"
> 
> Hi
> 
> I have a problem that I have solved using several data steps and PROC
> SQL. But I am sure that there is a much easier way of doing what I
> want.
> 
> DATA Temp;
> Input Var200203 Var200204 Var200205 VarLookUp $11.;
> DataLines;
> 1 2 3 Var200203
> 5 6 7 Var200204
> 3 6 9 Var200205
> ;
> RUN;
> 
> I am trying to code a variable (VarOut) that would look for the value
> in the appropiate column. In other words it must look for the value in
> VarLookUp and then go to that column and extract the appropiate value
> for it's row. Please bear in mind that I have just over 70 000 records
> and a slow PC :)
> 
> The output should look something like:
> 
> Var200203 Var200204 Var200205 VarLookUp VarOut
> 1         2         3         Var200203 1
> 5         6         7         Var200204 6
> 3         6         9         Var200205 9
> 
> Thanks in advance
> Richard Crawley-Boevey
> 
> 
> _______________________________________________________________________
> _____
> ______________________________________________________
> 
> For information about the Standard Bank group visit our web site
> <www.standardbank.co.za>
> _______________________________________________________________________
> _____
> ______________________________________________________
> 
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relating to the official
> business of Standard Bank Group Limited  is proprietary to the group.
> It is confidential, legally privileged and protected by law. Standard
> Bank does not own and endorse any other content. Views and opinions are
> those of the sender unless clearly stated as being that of the group.
> The person addressed in the e-mail is the sole authorised recipient.
> Please notify the sender immediately if it has unintentionally reached
> you and do not read, disclose or use the content in any way. Standard
> Bank can not assure that the integrity of this communication has been
> maintained nor that it is free of errors, virus, interception or
> interference.
> ___________________________________________________________________________
_
> _______________________________________________________
> 
> ------_=_NextPart_001_01C3575B.AC8E5DAC
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
> Hi
> 
> I have a problem=  that I have solved using several data steps and
> PROC SQL. But I am sure that there is a much easie= r way of doing what
> I DATA Temp; Input Var200203 Var200204 V= ar200205 VarLookUp
> ;
> 1= 23 Var200203
> 5= 6 7 Var200204
> 3= 6 9 Var200205
> ;
> RUN;
> 
> I am trying to code a variab= le (VarOut) that would look for the value
> in the appropiate column. In other words = it must look for the value
> in VarLookUp and then go to that column and ex= tract the
> 's r= ow. Please b= ear in mind that I have just over 70 000 records and a
> slow PC :)
> 
> The output shoul= d look something like:
> 
> Var200203 Var200= 204 Var200205 VarLookUp VarOut
> 1  &n= bsp;      2      &>nbsp;  3         Var200203 1>
> Thanks in advanc= e
> Richard Crawley= -Boevey
> _________________________________________________________>_______________________________________________________________________
>  __>For information about the Standard Bank group visit our web site \
> &lt>;<3d.htm>www.standardbank.co.za> = \
> _________________________________________________________>_________________________________________________________________________>
>  Disclaimer  and confidentiality note
> Everything in this e-mail and any attachment= s  relating to the
> official business of Standard Bank Group Limited  is=   proprietary
> to the group. It is confidential, legally privileged and = protected by
> law. Standard Bank does not own and endorse any other co= ntent. 
> Views and opinions are those of the sender unless clearly stated as
> being=  that  of the group.
> The person addressed in the e-mail is the sole authoris= ed  recipient.
> Please notify the sender immediately if it has unintentionally=  
> reached you and do not read,
> disclose or use the content in any  way.
> Standard Bank can not assure that the integrity of this communica= tion 
> has been maintained nor that it is free of errors, virus, interception or>  \
> interference. _________________________________________________________>__________________________________________________________________________
> 
> > 
> ------_=_NextPart_001_01C3575B.AC8E5DAC--
> Date:    Thu, 31 Jul 2003 10:05:29 -0400
> From:    "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
> Subject: Re: Where and Contains
> MIME-Version: 1.0
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Susie:
> 
> You can create a macro variable "array" from the text file input and
> dynamically build your where clause using the macro variables.
> 
> %let lmt = 0;
> data _null_;
> length lname
> fname $8;
> 
> infile cards eof=done;
> 
> input lname $ fname $ ;
> i + 1;
> 
> call symput('l'||left(put(i,4.)),lname);
> call symput('f'||left(put(i,4.)),fname);
> return;
> 
> done:
> call symput('lmt',left(put(i,4.)));
> cards;
> baljep raj
> chawla rejesh
> run;
> 
> %put _user_;
> 
> data demo;
> length lname
> fname $10;
> 
> LNAME = 'DROOGENDYK';FNAME='HARRY';    OUTPUT;
> LNAME = 'AABALJEP';  FNAME='RRRRAJJJJ';OUTPUT;
> LNAME = 'CHAWLAAAAA';FNAME='REJESH';   OUTPUT;
> run;
> 
> %macro do_found;
> data found;
> set demo;
> %if &lmt ne 0 %then %do;
> where ((lname contains (upcase(trim("&l1")))) and (fname
> contains
> (upcase(trim("&f1")))))
> %do i = 2 %to &lmt;
> or ((lname contains (upcase(trim("&&l&i")))) and (fname contains
> (upcase(trim("&&f&i")))))
> %end;
> %end;
> ;
> LFname=substr(lname,1,10)||'/'||substr(fname,1,10);
> run;
> %mend do_found;
> 
> %do_found;
> 
> proc print;
> var LFname;
> run;
> 
> 
> 
> -----Original Message-----
> From:   Susie Li [mailto:Susie.Li@US.SANOFI.COM]
> Sent:   Thursday, July 31, 2003 9:32 AM
> To:     SAS-L@LISTSERV.UGA.EDU
> Subject:        Where and Contains
> 
> I do a lot of string searches  based on partial
> information as in the
> following example.  This is as close to the SQL
> wild-card search as I get
> in SAS, by using "Where" and "Contains" together.
> 
> It is okay for checking one or two records this way,
> but gets rather
> cumbersome if I have to do many searches, since I have
> to type the
> "contains" text strings by hand one by one.  Is there
> an easier way to
> accomplish this by supplying a file instead?
> 
> 
> 
> data found;
> set demo;
> where ((lname contains (upcase('baljep'))) and
> (fname contains (upcase
> ('raj')))) or
> ((lname contains (upcase('chawla'))) and
> (fname contains (upcase
> ('rajesh')));
> 
> LFname=substr(lname,1,10)||'/'||substr(fname,1,10);
> 
> proc print;
> var LFname;
> run;
> 
> 
> 
> 
> Susie Li
> Sanofi-Synthelabo, Inc.
> 90 Park Ave
> New York, NY 10016
> (212)551-4385
> susie.li@us.sanofi.com
> 
> 
> Important:  The Information in this e-mail belongs to
> Sanofi-Synthelabo Inc.,
> is intended for the use of the individual or entity to
> which it is addressed,
> and may contain information that is privileged,
> confidential, or exempt from
> disclosure under applicable law.  If you are not the
> intended recipient, you
> are hereby notified that any disclosure, copying,
> distribution, or use of, or
> reliance on, the contents of this e-mail is
> prohibited.  If you have received
> this e-mail in error, please notify us immediately by
> replying back to the
> sending e-mail address, and delete this e-mail message
> from your computer.
> Date:    Thu, 31 Jul 2003 09:56:37 -0400
> From:    Rey <j-santos@TAMU.EDU>
> Subject: Re: &Region in macro does not resolve correctly...
> 
> 'Sorry, my earlier post did not appear under this thread.  Here's a
> re-post:
> 
> I appreciate all your responses.  Here's a snippet of the code:
> 
> %GLOBAL REGION ANALYSIS;
> 
> %MACRO WHICHANALR;
> 
> %IF &ANALYSIS=FRE %THEN %DO;
> 
> LIBNAME PDTS 'C:\SAS\INTRNET\RAWDATA';
> 
> ODS LISTING CLOSE;
> ODS html body=_webout(dynamic title="YES!PDS: Region &REGION Summaries")
> rs=none;
> ods proclabel="YES!PDS: &REGION Summaries";
> 
> *=====Subject Matter With Subcompetencies================; data
> subjWSC; set pdts.drsubjwsc;
> WHERE REGION=("&REGION");
> rename category_nameÊtegory
> comp_text=Competency
> sub_comp_text=Subcompetency
> prof_text=Proficiency_Stmt
> prof_level=Proficiency_Level
> Answer_1=Criticality
> Answer_2=Proficiency;
> proc format;
> value proflevf
> 1='core'
> 2='intermediate'
> 3='advanced';
> 
> value scaleF
> 1='1'
> 2='2'
> 3='3'
> 4='4'
> 5='5'
> 8='NA';
> run;
> 
> proc sort data=subjwsc; by Category; run;
> 
> 
> proc tabulate data=subjwsc format.0 order=internal;
> class Category Competency Subcompetency Proficiency_Stmt
> Proficiency_Level Criticality Proficiency; %include
> 'd:\backup-g\pdts\style5.txt'; table Competency *(Proficiency_Stmt
> all='THIS COMPETENCY') *Proficiency_Level all='ALL COMPETENCIES',
> Criticality*(n) Proficiency*(n)/ Box='Subject Matter Expertise
> Competencies (With Subcompetencies): Criticality/Proficiency Response
> Frequency';
> title "YES!PDS: Region &REGION Summaries";
> format Criticality Proficiency scaleF.;
> where criticality<=8 and proficiency<=8;
> by Category;
> run;
> 
> *>>>>>snipped>>>>>>>>>>>;
> 
> Thanks.
> Rey
> Date:    Thu, 31 Jul 2003 10:04:55 -0400
> From:    Ian Whitlock <WHITLOI1@WESTAT.COM>
> Subject: Re: Index Descending?
> MIME-Version: 1.0
> Content-Type: text/plain
> 
> In my mind indexing was introduced to locate specific records in a
> large data set quickly.  Now there is no ascending or descending in
> that notion. The question only becomes possible because SI allowed the
> use of the index in a side issue, BY-processing.
> 
> Since the use of an index for BY-processing all of the records in a
> large randomly ordered data set, is one of the quickest ways to
> dramatically increase the time of execution, I find the use of indexing
> for BY- processing a questionable decision in the first place.  So I
> see it as no surprise that extending the usage is not a high priority.
> 
> To me it would be far more useful to discard the use of indexing in
> BY-processing so that one could write
> 
> data small ;
> set big ;
> where index in ( ... ) ;
> by index ;
> /* more code */
> run ;
> 
> and have indexing used to produce records quickly as intended and have
> the sequence of those records depend on the sorted order of the file as
> usual. Currently one can easily write the code as two steps; one to do
> the subsetting, and one to do the BY-processing.  So this request is
> also not a high priority.
> 
> On another note, I strongly agree with Kevin that documentation is an
> aid to using the language and not a "proof" of the way the language
> works, although the closer it is to proof the better it will be as an
> aid.  Perhaps it is appropriate to point out that originally "proof"
> meant to test as in the expression, "The proof of the pudding is in the
> eating."
> 
> IanWhitlock@westat.com
> 
> -----Original Message-----
> From: Jack Hamilton [mailto:JackHamilton@FIRSTHEALTH.COM]
> Sent: Wednesday, July 30, 2003 8:38 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: Index Descending?
> 
> 
> A birdie tells me that descending indexes are not currently a high
> priority. If that's important to anyone, they can, of course, send a
> suggestion to suggest@sas.com and try to get it on the SASWare Ballot
> for future consideration.
> 
> In my version of English, "cancel"ing the use of an index requires that
> use of the index have been scheduled in the first place.  That is,
> deciding not to use an index is not the same as deciding to use it and
> then canceling that decision.  Your usage apparently varies.
> 
> 
> 
> 
> --
> JackHamilton@FirstHealth.com
> Manager, Technical Development
> Metrics Department, First Health
> West Sacramento, California USA
> 
> <snip>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic