LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 17 Mar 2010 14:59:04 -0500
Reply-To:   "Data _null_;" <iebupdte@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Data _null_;" <iebupdte@GMAIL.COM>
Subject:   Re: Compute After - Proc report
Comments:   To: "Audrey M." <amoreau1@yahoo.fr>
In-Reply-To:   <ce1fb7451003171246s6e88b4a7lf41f04cdeb9bd652@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

Here is example with simulated flow.

Richard A. Devenezia has a nice program for inserting split characters. http://www.devenezia.com/downloads/sas/samples/ split-into-words That you could use to insert split characters and ...

data test; infile cards truncover; input Patient :$2. Lab_parameter:$16. Value / comment1 $100. / comment2 $100.; order = _n_; cards; 01 Hematocrit 10.0 The data was confirmed by query. 01 Hemoglobin 11.0 The investigator confirmed the data. 02 Hematocrit 10.0

02 Hemoglobin 11.0 The investigator confirmed the data.

03 Hematocrit 10.0

03 Hemoglobin 11.0

;;;; run; proc print; run; proc report headline nowd list missing ls=97; columns patient lab_parameter comment: value; define patient / order width=8; define lab_parameter / order; define comment: / order noprint width=10; define value / display; break after patient / skip; compute before comment1; cmm1 = comment1; endcomp; compute before comment2; cmm2 = comment2; endcomp; compute after lab_parameter; rc2 = seechar(cmm1,'A:CMM1='); l1 = lengthN(cmm1); if l1 eq 0 then at1 = 0; else at1 = 43; l2 = lengthN(cmm2); if l2 eq 0 then at2 = 0; else at2 = 43; line @at1 cmm1 $varying100. l1; line @at2 cmm2 $varying100. l2; endcomp; run;

On 3/17/10, Data _null_; <iebupdte@gmail.com> wrote: > The LINE statement in PROC REPORT cannot be conditionally executed. > However, if the result of the LINE is length 0 no output is produced. > > My example does not address simulated FLOWing as you mentioned. I > would probably address that by creating the comments in a enumerated > variable list then you can test and print each varaible if it is not > blank. You need a program that will FLOW the COMMENT long varaible > into an enumerated variable list or insert split characters. > > data test; > infile cards truncover; > input Patient :$2. Lab_parameter:$16. Value / comment $100.; > order = _n_; > cards; > 01 Hematocrit 10.0 > The data was confirmed by query. > 01 Hemoglobin 11.0 > The investigator confirmed the data. > 02 Hematocrit 10.0 > > 02 Hemoglobin 11.0 > The investigator confirmed the data. > 03 Hematocrit 10.0 > > 03 Hemoglobin 11.0 > > ;;;; > run; > proc print; > run; > proc report headline nowd list missing ls=97; > columns patient lab_parameter comment value; > define patient / order width=8; > define lab_parameter / order; > define comment / order noprint width=10; > define value / display; > break after patient / skip; > compute before comment; > cmm = comment; > endcomp; > compute after lab_parameter; > *rc2 = seechar(cmm,'A:CMM='); > l = lengthN(cmm); > if l eq 0 > then at = 0; > else at = 41; > line @at cmm $varying100.-l l; > endcomp; > run; > > > On 3/17/10, Audrey M. <amoreau1@yahoo.fr> wrote: > > I need to create a listing like this: > > > > Patient Lab_parameter Value > > ________________________________________________________________________ > > 01 Hematocrit 10.0 > > The data was confirmed by query. > > Hemoglobin 11.0 > > The investigator confirmed the data. > > ... > > > > So my issue is that I need to put a comment under each laboratory > > value and in case I do not have a comment in COMMENTS or if the > > comments is too long, there is a blank line under each laboratory data > > or the comment is cut. > > I have tried the Compute after statement but I cannot delete this > > blank or I cannot have the end. So my question is : how to program in > > order to have this line(s) of comments present or not (depending if > > data are present or not in COMMENTS variable. > > > > Thanks. > > >


Back to: Top of message | Previous page | Main SAS-L page