Page 1 of 1

First Character Identification... Number or String???

Posted: Wed Jul 24, 2024 10:42 am
by kcaron
I'm trying to identify if the first character of a variable is a number or string.

My variable is %myvar and I am running a loop which is picking up cusips (numbers) and tickers (strings) from a group.

I am using @left to identify what the first character.

However, I need something to tell me if it is a number or a letter.

Does EViews have such a command?

Thanks!
KC

Re: First Character Identification... Number or String???

Posted: Wed Jul 24, 2024 12:38 pm
by EViews Gareth

Code: Select all

@isna(@val(@left(%myvar,1)))
Will return 1 if it is a character, and 0 if it is a number.

Re: First Character Identification... Number or String???

Posted: Wed Jul 24, 2024 1:25 pm
by kcaron
Worked great! Thank you!!
KC