@mid

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Lol38
Posts: 45
Joined: Wed Oct 02, 2013 4:00 pm

@mid

Postby Lol38 » Tue Jul 15, 2014 3:51 am

Hello,

I'm trying to use this combination of commands:

smpl if @mid(@str(ocup), 3, 1) = "2"

but the programme doesn't read it, what am i doing wrong?

The sample is something like this and i want to extract the third number which can be 0, 1 or 3:
10313
10313
99997
20311
80311
20312
30314
5002
40312
82314
34323

I am creating a dummy so that a can generate a series with the diffrents third numbers in this sample.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: @mid

Postby EViews Gareth » Tue Jul 15, 2014 8:21 am

Why do you have an ="2"?

Lol38
Posts: 45
Joined: Wed Oct 02, 2013 4:00 pm

Re: @mid

Postby Lol38 » Tue Jul 15, 2014 7:14 pm

Because i want to sort the series taking into account the third number but this number must be "2", i mean, all the groups of numbers in the serie that have the third number as a "2".

Then, i need the same condition but with the third number ="3" and another group with the third number in the serie ="1".

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: @mid

Postby EViews Gareth » Tue Jul 15, 2014 8:11 pm

I am completely lost. The sample statement works, selecting only observations for which the third number is equal to two. Why is it not working for you?

Lol38
Posts: 45
Joined: Wed Oct 02, 2013 4:00 pm

Re: @mid

Postby Lol38 » Wed Jul 16, 2014 3:01 am

I don't know. I thought the command "@mid" was wrong but then you tell me that it is ok. =(

I don't know what to do.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: @mid

Postby EViews Gareth » Wed Jul 16, 2014 8:45 am

It looks like everything is fine.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests