Page 1 of 1

Case-sensivity

Posted: Fri Mar 08, 2013 4:17 am
by farrel
Whether the Eviews is case-sensitive in strings?
i.e. here:
Cases 1) works, but case 2) doesn't.

1) %name_root = @left(%name_var, @instr(%name_var, "_mm"))
or
2) %name_root = @left(%name_var, @instr(%name_var, "_MM"))

Re: Case-sensivity

Posted: Fri Mar 08, 2013 9:02 am
by EViews Gareth
Yes, it is.

Re: Case-sensivity

Posted: Thu Mar 21, 2013 3:55 am
by farrel
aha. ok.
But then, sometimes it is vice versa. Case 2) works, but Case 1) doesn't. I have few subroutines with "_MM" uppercases. I wonder how it might be?! when all the elements in workfile have lowercases... What it depends on?

1) %name_root = @left(%name_var, @instr(%name_var, "_mm"))
2) %name_root = @left(%name_var, @instr(%name_var, "_MM"))

Regards
Andrei

Re: Case-sensivity

Posted: Thu Mar 21, 2013 7:48 am
by EViews Gareth
I don't understand your question. The @instr function is case-sensitive.

Re: Case-sensivity

Posted: Thu Mar 21, 2013 9:00 am
by farrel
Ok. let put it in an example. My confusion is the following. In the code below, I generate series ser1_mm and ser2_mm, having in mind they are lowercases. Then to subtract suffix "_mm" (lowercase) I exploit @instr with uppercase "_MM". Why "_MM" in uppercases? Note, "_mm" (lowercase) doesn't work for me later to obtain ser1_yy and ser2_yy. What forces Eviews to understand "_MM", but not "_mm"?

Code: Select all

smpl @all genr ser1_mm = 0 'lowercase!! genr ser2_mm = 0 'lowercase!! group _gr_ser ser1_mm ser2_mm for !C = 1 to _gr_ser.@count %name_endog = _gr_ser.@seriesname(!C) %name_endog_root = @left(%name_endog, @instr(%name_endog, "_MM")-1) '_MM is uppercase!! why?? genr {%name_endog_root}_yy = {!C} next
Regards
Andrei

Re: Case-sensivity

Posted: Thu Mar 21, 2013 9:23 am
by EViews Gareth
Objects in a workfile are case insensitive. There is no difference between the series "AAA" and the series "aaa". They are the same series. You can create a series called "AAA" and it will be shown as "aaa" in the workfile. You can refer to that series as "aaa" or "AAA" and EViews will know what you mean.

Functions that work with strings are, in general, case-sensitive.

Functions that return information about objects as a string are, in general, returned in upper-case.

Re: Case-sensivity

Posted: Fri Mar 22, 2013 6:32 am
by farrel
ok. thanks. Now I understood what the problem is. I have another example below, where I treated series name as string without refering to object, that's why in this case "_mm" (lowercases) was the solution, but not "_MM". This raised my confusion.
In turn, in previous example I treated series names as strings refering to group objects.

Code: Select all

smpl @all genr ser1_mm = 0 'lowercase!! call mysub("ser1_mm") subroutine mysub(string %name_var) %name_endog_root = @left(%name_var, @instr(%name_var, "_mm")-1) ' Now "_mm" works, but not "_MM" genr {%name_endog_root}_yy = 1 endsub
But then do we have any function that extracts string referring to series name? something similar to what we have for group elements:

(from the code before)
group _gr_ser ser1_mm ser2_mm
%name_endog = _gr_ser.@seriesname(!C)

potentially might be something like this to extract series name as string:
%name_endog = ser1_mm.@seriesname

Re: Case-sensivity

Posted: Fri Mar 22, 2013 7:51 am
by EViews Gareth
All objects have a .@name data member.

Re: Case-sensivity

Posted: Fri Mar 22, 2013 11:02 am
by farrel
Thanks.

Andrei