f

Re: SAS time problem and formula problem

```Hello Vijay

for me. (SAS-L removes attachments, incl the picture showing your formula)

Consider this data step ...

data in;
format hr hhmm5.;

hr = '45:00't; /* <-- 45 hours and 0 minutes -- */

hrn = hr/(60*60); /* <-- number of decimal hours from
0 minutes. Using the hour()
function will return 21 which
is incorrect -- */

loghrn = log(hrn);  /* <-- gives you the 3.807 -- */
run;

I think the issue is the value of hr. You see 45:00 which is the
representation of the SAS hhmm5. format. The SAS stored value is a numeric
162000, the number of seconds since the time 0 or 00:00. When you use the
formula log(hr) you are doing log(162000) and not log(45) as you may want.

HTH

Magnus

On Mon, 3 Nov 2003 11:51:14 +0000, Vijay Reddi <Vijay.Reddi@SSL-
INTERNATIONAL.COM> wrote:

>Hi All,
>
>I have two problems, and I really hope you can help me.
>
>The first problem is that I want to take the Log of a time variable (format
>is hhmm6.), but the answer returned is wrong. I have used the following
>code:
>
>/* p is a time variable with format hh:mm5.*/
>
>data 'C:\Vijay Data\Research project\Project\Data\craw4';
>     set craw3_1;
>     ln_aa=log(p);
>     format ln_aa hhmm5.;
>run;
>
>For example if p=45:00 (hh:mm) then ln_aa equals 00:00 (hh:mm) but I want
>it to read 3.807.  The answer I want is in units of hours, how can I get
>
>The second problem is that I want manipulate data in a way that will allow
>me to use a formula. Let me clarify this by using an example, if I had two
>variables (x and y) and I want a data step to calculate the following
>equation:
>
>(Embedded image moved to file: pic09961.pcx)
>
>how would I do it?
>
>Any help would be grateful appreciated.
>
>Regards
>
>Vijay Reddi
>Senior Quality Assurance Statistician
>Tel:+44 (0)1223 423232 (235)
>Fax:+44 (0)1223 426926
>
>___________________________________________________________________________
______
>The information contained in this e-mail is confidential and may be
privileged.
>It is intended for the addressee only.  If you are not the intended
recipient,
>please delete this e-mail immediately.  The contents of this e-mail must
not be
>disclosed or copied without the consent of the sender.
>
>The statements and opinions expressed in this message are those of the
author
>and do not necessarily reflect those of the Company.  The Company does not
take
>any responsibility for the views of the author.
>
>No contracts may be concluded on behalf of the Company or any of it's
subsidiaries
>or divisions by means of email communications.
>
>Although we have taken steps to ensure that this email and attachments are
free
>from any virus, we cannot accept any responsibility for viruses so email
>attachments should be virus-checked on receipt.
```
 0
11/3/2003 1:09:04 PM
comp.soft-sys.sas 142827 articles. 4 followers.

0 Replies
984 Views

Similar Articles

[PageSpeed] 43

Similar Artilces:

Re: SAS time problem and formula problem #2
Please re-post your second question and present the formula in-line, as part of the message. SAS-L does not allow attachments. Also make it a separate posting, with its own subject. When a person has two or more unrelated questions, there is no reason to bundle them in one posting. It's not as if one has to pay for postage. Making a separate posting for each question, with appropriate subjects, makes it much easier to carry on and follow the discussions. On Mon, 3 Nov 2003 11:51:14 +0000, Vijay Reddi <Vijay.Reddi@SSL- INTERNATIONAL.COM> wrote: >Hi All, > >I have two probl...

SAS time problem and formula problem
Hi All, I have two problems, and I really hope you can help me. The first problem is that I want to take the Log of a time variable (format is hhmm6.), but the answer returned is wrong. I have used the following code: /* p is a time variable with format hh:mm5.*/ data 'C:\Vijay Data\Research project\Project\Data\craw4'; set craw3_1; ln_aa=log(p); format ln_aa hhmm5.; run; For example if p=45:00 (hh:mm) then ln_aa equals 00:00 (hh:mm) but I want it to read 3.807. The answer I want is in units of hours, how can I get this answer? The second problem is that I want ma...

Re: SAS/Warehouse Administrator Problem?? or SAS/ACCESS problem??
I'm pretty sure that behind the scenes SAS/Warehouse Administrator is generating and running SQL code. If you can expose that code and post it here it might help. On Sun, 23 Apr 2006 21:53:41 -0700, saivs28@GMAIL.COM wrote: >hello, > >I've built a process in SAS/Warehouse Administrator, where i'm trying >to extract distinct cities from the 3 tables(source schema) in Oracle >into a new table (target schema) called CITY and again into UniqueCity >(target schema) bcos of some redundancy. The process looks like this. > > Unique ...

Re: SAS/Warehouse Administrator Problem?? or SAS/ACCESS problem?? #2
What's the question? I know it you presented it earlier, but you can't expect people to find the pieces of a problem and put them together. Look at the various intermediate results and find the point where they first diverge from what is expected. Then look at the code which generates that particular result. De-macroize that code and prepare some test data so that anybody can run it easily. Then present that isolated version of the problem (if the answer has not already emerged during this process). On Mon, 24 Apr 2006 11:19:35 -0700, saivs28@GMAIL.COM wrote: >The following code ...

SAS/Warehouse Administrator Problem?? or SAS/ACCESS problem??
hello, I've built a process in SAS/Warehouse Administrator, where i'm trying to extract distinct cities from the 3 tables(source schema) in Oracle into a new table (target schema) called CITY and again into UniqueCity (target schema) bcos of some redundancy. The process looks like this. Unique City | | mapping | | CITY ...

SAS/Warehouse Administrator Problem?? or SAS/ACCESS problem?? #2
hello, I've built a process in SAS/Warehouse Administrator, where i'm trying to extract distinct cities from the 3 tables(source schema) in Oracle into a new table (target schema) called CITY and again into UniqueCity (target schema) bcos of some redundancy. The process looks like this. Unique City | | mapping | | CITY ...

Re: SAS formula problem
Hi Reddy, It depends how your data are organized. If all your x and y values (1..n) are within a single observation as repeated measures, you might want to obtain a z-value per observation. If your different x and y values are stored in different records, you may want a single z-value for the whole data file. I think your pseudo-code may be rewritten, without changing it, as: z=[sum i=1 to n](x(subscript: i)/y(subscript: i) + x(subscript: i)) In the first case you would have to work with arrays (*untested, just scratch*): %LET N = .....; %* Whatever N you have; DATA New (DRO...

Re: SAS formula problem #3
Hi Howard, Yes, you are right, I did not test my code, Q&D quality you know. Indeed the initialization of Z to 0 can be left out completely as the sum statement involving Z already does that once. And of course the value 0 should be 1 in the test for EndOfSet. Regards - Jim. -- .. . . . . . . . . . . . . . . . Jim Groeneveld, MSc. Biostatistician Science Team Vitatron B.V. Meander 1051 6825 MJ Arnhem Tel: +31/0 26 376 7365 Fax: +31/0 26 376 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com My computer has the solutions, I have the problems. [common disclaimer] -----O...

Re: sas date time problem
On Tue, 20 Jun 2006 08:09:40 -0400, Ankur Arora <ankur.arora@NAGARRO.COM> wrote: >Hi, > >I have a question of data in which we are importing the data with proc >imports.Now in one of the variables i have is 2005-03-09T01:54:25 >which gets truncated to 2005-03-09.Can anybody help on this since i want >to use proc import for importing the dataset with time formatted in the >above format. PROC IMPORT is fine for consistently structured data which follow the rules. Your data-time values do not conform to the SAS datetime informat, which would represent the sample val...

Re: SAS formula problem #2
Since Vijay says he has two variables, not 2*n variables, I assume the second structure. When I tested I found two errors in Jim's code. The statement initializing Z to zero should come out; it is contrary to the requirement. The IF condition, as coded, outputs all except the final observation, so it should be reversed IF (EndOfSet EQ 1) THEN OUTPUT; or IF EndOfSet THEN OUTPUT; I would also include drop x y; since they do not represent the same degree of summarization as does the single value of Z. The SQL solution is a bit more natural: select sum(x/y) + sum(x) from o...

Re: problem when installing SAS. windows x64 does not support SAS?
2 things you can do: 1) switch to 32-bit vista (business / ultimate) 2) or wait for a new version of SAS supporting 64-bit windows On Wed, May 14, 2008 at 10:54 AM, <elodie.gillain@gmail.com> wrote: > Hi everyone > > I am trying to install SAS on a Vista machine. > > The setup wizard says that Windows x64 does not support the SAS > version I am trying to install. > > What can I do? > > I greatly appreciate your help. > -- =============================== WenSui Liu ChoicePoint Precision Marketing Phone: 678-893-9457 Email : wensui.liu@choicepoint.com ...

Re: sas date time problem #2
hi Thanks very much for replying back ya we have a naming convention that time variable is always as the last variable naming convention for the data is first data STUDYID USUBJID DOMAIN BWSEQ BWGRPID BWTESTCD BWTEST BWORRES BWORRESU BWSTRESC BWSTRESN BWSTRESU BWBLFL BWSTDTC BWENDTC BWSTAT BWREASND DP1111 13 BW 34 BW Body Weight 266.4 g 266.4 266.4 g Y 2005-03-09T01:54:25 In the second data the prefix "bw" changes to "ss" can we somehow have a command in proc import which changes the format of all the variables to character format so that date is read as it is Than...

Re: sas date time problem #3
On Tue, 20 Jun 2006 12:56:50 -0400, Ankur Arora <ankur.arora@NAGARRO.COM> wrote: >hi > >Thanks very much for replying back ya we have a naming convention that >time variable is always as the last variable >naming convention for the data is > >first data >STUDYID USUBJID DOMAIN BWSEQ BWGRPID BWTESTCD BWTEST BWORRES > BWORRESU BWSTRESC BWSTRESN BWSTRESU > BWBLFL BWSTDTC BWENDTC BWSTAT BWREASND >DP1111 13 BW 34 BW Body Weight 266.4 g > 266.4 266.4 g Y 2005-03-09T01:54:25 You have presented this sample, several times, and it raises questions, since ther...

Re: problem when installing SAS. windows x64 does not support SAS? #2
Elodie, Take a look at: http://support.sas.com/kb/16/568.html HTH, Art --------- On Wed, 14 May 2008 07:54:57 -0700, elodie.gillain@GMAIL.COM wrote: >Hi everyone > >I am trying to install SAS on a Vista machine. > >The setup wizard says that Windows x64 does not support the SAS >version I am trying to install. > >What can I do? > >I greatly appreciate your help. ...

problems problems problems
(The short(?) summary) I've got an Access MDB file and a DAO connect with it.. Problem 1 of 2 The below gives me a runtime error 91 Object variable or With block variable not set. I've got the db stuff after the form.show (to make sure all the objects on the form are loaded before attempting to utilize/manipulate them) But it doesn't like it when I use the data object in the form load anyway for some reason.. pffft. Private Sub Form_Load() frmTest1Project.Show datGallery.Recordset.MoveLast datGallery.Recordset.MoveFirst Call LockTextBoxes(frmTest...

Re: Transfering datasets to Unix /SAS from PC/SAS
Md Alam: Most often failures of ftp to transfer a valid SAS dataset from Unix to a PC platform result from transferring the file using a MODE other than BINARY. Try a binary mode transfer. Sig -----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Md Alam Sent: Friday, November 04, 2005 11:34 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Transfering datasets to Unix /SAS from PC/SAS - Still problem Thanks for all your help. I tried using FTP to tranfer datasets from unix to PC. But when I am trying to open the datasets in PC after being tra...

Re: problem when installing SAS. windows x64 does not support SAS? #3
What about having a Virtual Machine with XP for example and SAS inside in your x64? Arthur Tabachneck <art297@NETSCAPE.NET> escribi�: Elodie, Take a look at: http://support.sas.com/kb/16/568.html HTH, Art --------- On Wed, 14 May 2008 07:54:57 -0700, elodie.gillain@GMAIL.COM wrote: >Hi everyone > >I am trying to install SAS on a Vista machine. > >The setup wizard says that Windows x64 does not support the SAS >version I am trying to install. > >What can I do? > >I greatly appreciate your help. --------------------------------- Yahoo! Encuentros Ahora...

Re: Transfering datasets to Unix /SAS from PC/SAS
Proc download example: /* signon to unix host from PC/SAS */ options comamid=tcp remote=rhost; /* name of your unix host */ FILENAME RLINK '!sasroot\connect\saslink\tcpunix.scr'; signon; run; /* Copy unix SAS Dataset to PC */ libname pclib 'C:\somedir\'; rsubmit; libname unixlib '/home/xxx/xxx'; proc download data=unixlib.student out=pclib.student; run; endrsubmit; signoff; -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Md Alam Sent: Friday, November 04, 2005 10:34 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Transfering ...

Re: Transfering datasets to Unix /SAS from PC/SAS
Hi, Re: <<...tried using FTP --- Invalid header on file...>> If, as Art sagely mentions, the versions of SAS on both platforms are 7 or after, then one note worthy thing to check is that when transferring a dataset with FTP, you must toggle the FTP utility to NOT do any byte convertions. i.e. set mode to BINARY (IMAGE on some platforms). You can certainly make a quick check before and after the transfer with your favorite editor or utility to just look the first bunch of bytes in hex, or whatever, to see if the bytes did not change. The FTP utilities on different platforms, some...

Re: RE : SAS Programming With Dates -Problem
Thank you very much for your feedback. I would appreciate for your help for a simple code addressing this issue in proc expand. Thanks, Doyle -------------- Original message -------------- > Have you seen the proc expand ? > > Otherwise, you could create a table with all dates and merge it with the > original table. > > St�phane. > > -----Message d'origine----- > De : SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] De la part de Doyle > Kalumbi > Envoy� : lundi 9 mai 2005 22:31 > � : SAS-L@LISTSERV.UGA.EDU > Objet : SAS Programming With Dates -P...

Re: SAS Problem.
Kijoeng, If you can I would read your date variables in as SAS Date values since they will be a scaler as the number of days since I think january 1, 1960. Obviuosly this would make your world so much easier. But using your example here is a solution: data t1 ; input enter \$ 1-10 disc \$ 12-21 x \$ 23 id 25 ; datalines ; 01/07/2003 01/07/2003 g 2 02/07/2003 05/07/2003 h 2 06/07/2003 10/08/2003 g 2 01/09/2003 02/09/2003 h 2 05/10/2003 05/10/2003 k 2 01/07/2003 01/07/2003 g 3 02/07/2003 05/07/2003 h 3 01/08/2003 10/08/2003 k 3 01/09/2003 02/09/2003 h 3 05/10/2003 05/10/2003 k 3 ; run ; data t...

Re: SAS Problem
You may want to look at PROC RANK. It will allow you to rank records and has ways of dealing with ties. PROC RANK does not have a weight or a freq statement. If your count variable has frequency counts you will then need to use PROC UNIVARIATE. On Thu, 27 Apr 2006 09:21:57 -0400, Bill Edwards <dean@DREAMNET.CO.NZ> wrote: >I have a SAS problem and hope someone can help. >I want to create deciles (1-10) based on a known \$dollar value for a city >and then compare that decile \$ value against other cities and see which >cities are richer or poorer in comparison. >I know t...

Re: How many files can you have in a VMS directory without performance problems? performance problems? performance problems? problems? performance problems? performance problems? problems? perfo
First, does anyone know why Info-VAX goes nuts on subjects from time to time? (Or is the trouble elsewhere?) From: JF Mezei <jfmezei.spamnot@teksavvy.com> > DELETE Z*.*;* > DELETE Y*.*;* > ... > DELETE A*.*;* > > (followed by the numbers). This scheme may be a bit obsolete. See: http://h71000.www7.hp.com/doc/731FINAL/4506/4506pro_014.html#index_x_890 I quote: [...] 5.2.3.1.2 Extended Character Set In addition, OpenVMS V7.2 on Alpha systems and ODS-5 disks includes support for the use of file names, and subdirectory and root subdirectory names, tha...

Re: How many files can you have in a VMS directory without performance problems? performance problems? performance problems? problems? performance problems? performance problems? problems? perfo #2
On 8/17/05, Mark Berryman <mark@theberrymans.com> wrote: > Steven M. Schweda wrote: > > First, does anyone know why Info-VAX goes nuts on subjects from time > > to time? (Or is the trouble elsewhere?) >=20 > Elsewhere. Info-VAX does not rewrite the subject. >=20 > Mark Berryman > Info-VAX admin >=20 I thought it was reacting to poster sanity bugchecks. : ^ ) WWWebb --=20 NOTE: This email address is only used for noncommerical VMS-related correspondence. All unsolicited commercial email will be deemed to be a request for services pursuant to the t...

Web resources about - Re: SAS time problem and formula problem - comp.soft-sys.sas

Is–ought problem - Wikipedia, the free encyclopedia
The is–ought problem in meta-ethics as articulated by Scottish philosopher and historian David Hume (1711–76) is that many writers make claims ...

When Fairfax's Harriet Alexander takes her son to hospital with red, puffy eyes, she learns an important lesson about taking health advice from ...

Marco Rubio Has a Second Amendment Problem
... in 1999, he voted to ban guns from local parks. Now, politicians make mistakes. And honest politicians “fess up” and move on. Rubio's problem ...

SpaceX’s new rocket fuel is causing problems with a mission that the company will try to launch for the ...
... Elon Musk has suffered a series of setbacks that have led it to postpone the same launch three different times. The root of the problem is ...

Here's the problem with index ETFs
Index ETFs have grown in popularity but they aren't always a wise strategy, says Michael Farr. Here's why.

Feds: Here’s Another HUGE Problem With Green Energy
Feds: Here’s Another HUGE Problem With Green Energy

Donald Trump poses a problem for a Republican senator in Alabama
... of Tuesday with a big enough chunk of the vote to avoid a run-off. That's thanks to the fact that Donald Trump is on the ballot, and the problem ...

The Problem with Reactionary Marketing
The Problem with Reactionary Marketing written by Alex Boyer read more at Duct Tape Marketing Digital marketing is constantly changing, and ...

Can This Guy Fix The 200-Million Unconnected Car Problem?
Parallel parking on the mean, crowded streets of San Francisco is a grueling rite of passage most newcomers can't avoid. They soon learn that ...

MEATY PROBLEM Feds have big beef with Bundy's million-dollar herd
MEATY PROBLEM Feds have big beef with Bundy's million-dollar herd

Resources last updated: 3/3/2016 6:06:40 AM