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 (July 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 24 Jul 2006 13:23:42 -0400
Reply-To:     Xu Libin <Libin.Xu@IRS.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Xu Libin <Libin.Xu@IRS.GOV>
Subject:      Re: Read the date variable?
Comments: To: Nathaniel_Wooding@Dom.com
In-Reply-To:  <OF5A9389A5.530CAD27-ON852571B5.0050BA2C-852571B5.0050FF45@dom.com>
Content-Type: text/plain; charset="us-ascii"

I have no idea how the variable was created. My coworker provided me a solution and it worked: 1. compress the variable which has the value of 01/01/1960 or 20051025. 2. create three variables by extracting the month, day, and year of the compressed variable with value 0 or 20051025. 3. create a variable with the right format by using the mdy function on the month, day and year variables. 4. Format the variable mmddyy10.

I still have question about this approach conceptually though. Thanks a lot for your help.

Libin

-----Original Message----- From: Nathaniel_Wooding@Dom.com [mailto:Nathaniel_Wooding@Dom.com] Sent: Monday, July 24, 2006 10:45 AM To: Xu Libin Cc: sas-l@listserv.uga.edu Subject: RE: Read the date variable?

Libin

The values such as 2680000000000000 that you show below are not readily recognizable dates. How was this text file produced. Could the dates be some sort of internal time stamp used by a computer system such as MVS?

Nat Wooding

"Xu Libin"

<Libin.Xu@irs.gov

> To <Nathaniel_Wooding@Dom.com>

07/24/2006 10:32 cc AM

Subject RE: Read the date variable?

Thank you for your attention. The syntax is something like this:

Data new; Infile 'C:\old.txt'; Input datevar Format datevar mmddyy10.; Run;

Proc freq data=new; Table datevar; Run;

The text file has the value of the variable as either 15 '0's or other digits such as 232000000000000, or 2680000000000000, or 2950000000000000. The viewtable shows the value format as 01/01/1960 or 20051025, but the frequency table gives 01/01/1960 or **********. Hope this clarifies the issue. Thanks.

Libin -----Original Message----- From: Nathaniel_Wooding@Dom.com [mailto:Nathaniel_Wooding@Dom.com] Sent: Monday, July 24, 2006 9:56 AM To: Xu Libin Subject: Re: Read the date variable?

Libin

What do your dates look like in the text file?

Are they something like

20051231 or 2005/12/31

or is the date something like this but with time values attached (you do say that the text field is 15 wide).

The date of 01/01/1960 indicates that you have read a value of 0 for the date.

Please give a little more idea of what the text looks like and also what your input statement looks like.

nat wooding

Xu Libin

<Libin.Xu@IRS.GOV

> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU

Discussion" cc <SAS-L@LISTSERV.U

GA.EDU> Subject Read the date variable?

07/24/2006 09:49

AM

Please respond to

Xu Libin

<Libin.Xu@IRS.GOV

>

Dear List Members,

I tried to read a date variable in a text file. The variable's width is 15. It is read as numeric and then formatted as mmddyy10. When I look at the value in the viewtable, the value is either 01/01/1960 or some other dates displayed such as 20051025. But when I run frequency of the date, I got two values: 01/01/1960 or **********. Could someone advise me how this could be fixed? Thanks very much for your assistance.

Libin

----------------------------------------- CONFIDENTIALITY NOTICE: This electronic message contains information which may be legally confidential and/or privileged and does not in any case represent a firm ENERGY COMMODITY bid or offer relating thereto which binds the sender without an additional express written confirmation to that effect. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.

----------------------------------------- CONFIDENTIALITY NOTICE: This electronic message contains information which may be legally confidential and/or privileged and does not in any case represent a firm ENERGY COMMODITY bid or offer relating thereto which binds the sender without an additional express written confirmation to that effect. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.


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