| Date: | Fri, 28 May 1999 11:04:45 +1000 |
| Reply-To: | Arun Rastogi <arunr@OZEMAIL.COM.AU> |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | Arun Rastogi <arunr@OZEMAIL.COM.AU> |
| Subject: | Re: Creating an informat |
| Content-Type: | text/plain; charset="iso-8859-1" |
Hi Mark,
depending on the form of your input data, you may be able
to read it in using a similar informat, eg ddmmyy, by
concatenating some extra data in front of it. If your data
contains delimiters, you might also try the compress function.
Try the following :
data thing ;
input @1 cmonth $7. ;
month=input("01"!!compress(cmonth,'.Mm/- '),ddmmyy8.);
format month mmyyn6. ;
cards;
051999
05.1999
05m1999
05M1999
05/1999
05-1999
;
run;
Hope this helps.
Cheers
Arun
ARUN RASTOGI
Director
Qual I.T. Services Pty Ltd. (Sydney, Australia)
http://www.qual-it.com.au
-----Original Message-----
From: Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Newsgroups: bit.listserv.sas-l
To: SAS-L@UGA.CC.UGA.EDU <SAS-L@UGA.CC.UGA.EDU>
Date: Tuesday, 25 May 1999 7:14
Subject: Re: Creating an informat
>No real solution seems available short of creating an informat to
>support MMYYw. with SAS/Toolkit.
>
>However, if you have any design influence, there is informat YYMMxw.
>Perhaps the source might be amenable to change
>
>
>Terjeson, Mark <TERJEMW@DSHS.WA.GOV> writes
>>Hi everyone,
>> I am looking for an INFORMAT corollary to the
>>the outgoing FORMAT MMYYxw.
>> The input data would be such as 051999. There
>>there doesn't seem to be an informat for that, such
>>as MMYYN6.
>>
>> The PICTURE feature of PROC FORMAT seems
>>to be for output only. However, the on-line documentation
>>under PICTURE contains and entry called "Create an Informat"
>>which then eludes to some capabilities in the SAS/ASSIST module.
>>I do not currently have SAS/ASSIST on-line.
>>
>> Yes, I could read as $6. and parse it into the MDY() function,
>>but I am trying to keep a particular process generic for dynamically
>>building the input statements, and would like to avoid the custom code.
>>
>> Does anyone have an alternative solution to input data
>>directly into a sas date from the text data structured as MMCCYY?
>>
>>Thanks in advance,
>>
>>Mark Terjeson
>>Washington State Department of Social and Health Services
>>Research and Data Analysis
>>(360) 902-0741
>>terjemw@dshs.wa.gov
>
>--
>Peter Crawford (_knowledge_ is a poor substitute for *real* experience,
> but they make a great team)
>
|