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 (December 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 14 Dec 2007 08:03:28 -0500
Reply-To:     Nathaniel.Wooding@DOM.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject:      Re: Pb to import date into a SAS datamart
Comments: To: manie <baroux.s@MAC.COM>
In-Reply-To:  <>
Content-Type: text/plain; charset="US-ASCII"


An addendum to Andre's comments.

I did not see that he mentioned it but your variable


is spelled

ase_strat_date in the input statement.

Also, you specify a character informat for cust_nr but then have

if cust_nr not = .;

Here, sas expect cust_nr to be a numeric variable since you ask do delete the obs when it value of cust_nr is missing. If all of the instances of the variable are numeric, you can either specify a numeric informat (say 8.) or simply delete the informat statement and SAS will automatically read it as a numeric variable.

Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977

manie <baroux.s@MAC.COM > To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Pb to import date into a SAS datamart 12/14/2007 03:58 AM

Please respond to manie <baroux.s@MAC.COM >


I try to import a flat file tab delimited file into a SAS datamart and receive errors on data fields/

The source file is like this: 100098 abc informatique 1/02/04 1/09/06 100099 abc informatique2 1/02/05 21/12/06

I run the code:

data emeawork.dataset_test; infile "c:\file_test.txt" delimiter = '09'x firstobs = 1 lrecl=1000; informat cust_nr $10.; informat ase_start_date ddmmyy6.; informat ase_end_date ddmmyy6.; input cust_nr ase_strat_date ase_end_date; if cust_nr not = .; run; if cust_nr not = .; I receive an error: "invalid format for ase_start_date in line " I've tried with format ddmmyy8. and with the fomat in the "input" instead of "informat" but I receive the same error.

Can you help me to find the right syntax?



----------------------------------------- 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