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 (August 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 23 Aug 2007 08:48:03 -0400
Reply-To:     Nathaniel.Wooding@DOM.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject:      Re: multiple dlm
Comments: To: Captain <apsteinberg@HOTMAIL.COM>
In-Reply-To:  <1187868529.313528.269380@q3g2000prf.googlegroups.com>
Content-Type: text/plain; charset="US-ASCII"

Try the code below which reads the entire line and holds it so that you can strip out the quotes and then read the line with the comma as a dlm and also the comma informat (as someone else has already suggested) to handle the amounts. My test file contained the line

1,"234",$12.34

filename indd 'c:\park\odddlm.txt'; data a; infile indd dlm=',' truncover ; input @; _infile_ = compress(_infile_,'"'); input @1 num1 num2 amount comma8.2 ; run; proc print; run;

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

Captain <apsteinberg@HOTM AIL.COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject multiple dlm

08/23/2007 07:28 AM

Please respond to Captain <apsteinberg@HOTM AIL.COM>

Hi I have a txt file which has a dlm of "," for most of the variables. I then have 3 date variables on the same file that use just a , as the dlm. After these 3 date variables I have 3 payment variables that also use the , dlm and have a $ to begin the variable. The file is reading in everything except the 3 date variables (including the payment variables).

I need to know a way to read in the file using multiple dlms, I can not use line input since it is a dlm file.

Thanks

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