Date: Sat, 2 May 1998 03:18:15 GMT
Reply-To: kurt_beckman@earthlink.net
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Kurt Beckman <kurt_beckman@EARTHLINK.NET>
Organization: All USENET -- http://www.Supernews.com
Subject: Re: Date problem in SAS 6.07
Content-Type: text/plain; charset=us-ascii
Date: Fri 01 May 1998 2010 PDT
Subject: Date problem in SAS 6.07
Summary: Make It a SAS Date Value
From: Kurt Beckman (kurt_beckman@earthlink.net)
To: jbp797@aol.com (Jbp797)
Dear Jbp797:
On 02 May 1998 02:02:19 GMT,
in <1998050202021900.WAA05727@ladder01.news.aol.com>
you wrote:
>All -
>
>Here is another problem I'm having, but can live with if there are no
>suggestions.
>
>I'm bringing in to VSAM files that have a century compliant date that is
>packed,
>( PD5.0), which translated to character reads like this: 19980501. That
doesn't
>look great on a report, but no matter how I've tried to reformat, I can't get
>it any other way. What I would like is : 05/01/98 or even 05/01/1998. Don't
>really care
>but I would like it to read better than the 19980501. Any ideas?
>
>Thanks...JP
I don't know of a SAS date informat that will read a packed decimal
field so we need a extra statement to get our SAS date value. Once we
do that we can write the SAS date value in any format we like.
I don't have any VSAM files with packed decimal fields in them so first
we will simulate that.....
311 data _null_ ;
312 attrib dateno length=4 ;
313
314 dateno = 19980101 ;
315
316 file sasparm ;
317 put dateno pd5.0 ;
318
319 stop ;
320 run ;
NOTE: The file SASPARM is:
FILENAME=D:\sas612\SASPARM.DAT,
RECFM=V,LRECL=256
NOTE: 1 record was written to the file SASPARM.
The minimum record length was 5.
The maximum record length was 5.
NOTE: The DATA statement used 0.05 seconds.
321
322 data _null_ ;
323 attrib datevar length=4 format=date9. ;
324
325 infile sasparm ;
326 input datepd pd5.0 ;
327
328 datevar = input(put(datepd,z8.),yymmdd8.) ;
329
330 put datevar=5. datevar= datevar=mmddyy10. datevar=worddate. ;
331
332 stop ;
333 run ;
NOTE: The infile SASPARM is:
FILENAME=D:\sas612\SASPARM.DAT,
RECFM=V,LRECL=256
DATEVAR=13880 DATEVAR=01JAN1998 DATEVAR=01/01/1998 DATEVAR=January 1,
1998
NOTE: 1 record was read from the infile SASPARM.
The minimum record length was 5.
The maximum record length was 5.
NOTE: The DATA statement used 0.05 seconds.
You will of course note that there are no filthy character/numeric
conversion messages (I hate those)....
I hope this information will be of some help to you. If
there are any questions please do not hesitate to contact
me at the numbers listed below.
Sincerely
Kurt D. Beckman
SAS Consultant
553 N. Pacific Coast Hwy, Suite B288
Redondo Beach, California 90277
Voice: 310-318-5291
Fax: 310-318-6220
Cellular: 310-486-4447
E-Mail: kurt_beckman@earthlink.net
102146.2003@compuserve.com