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 (September 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 8 Sep 2003 15:12:02 +0200
Reply-To:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:   Re: Invalid Third argument
Content-Type:   text/plain; charset="iso-8859-1"

Hi Jim,

You supply minimal info, but from what I can see your substr argument tries to gather 9 characters from position 4, where I count only 7 to be present. Besides, needing only 6, as understood from the format, why then don't you limit the length to 6 in the third substr argument? Or did you think that argument represents the ending position? No, it represents the number of characters to gather. So changing 9 to 6 would solve your little problem.

Regards - Jim.

Y. (Jim) Groeneveld MSc Biostatistician Vitatron B.V. Meander 1051 6825 MJ Arnhem The Netherlands +31/0 26 376 7365; fax 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com

-----Original Message----- From: jsl [mailto:nospam@NOSPAM.COM] Sent: Monday, September 08, 2003 14:47 To: SAS-L@LISTSERV.UGA.EDU Subject: Invalid Third argument

Below are a few lines pasted from my SAS log. I am reading a text field called "cusip" and putting a substring of it into another field per line 89 below. I keep getting the invalid argument message below, even though it appears to be working. Anybody understand why? Should I be concerned?

Thanks,

Jim

89 CNUM6disc=input(substr(cusip,4,9),$6.);

NOTE: Invalid third argument to function SUBSTR at line 89 column 21.

... cusip=0003184701 ...CNUM6disc=318470


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