Page 1 of 1

Creating a table with @pcy in a row

Posted: Wed Dec 12, 2012 1:35 pm
by afryan
I'm writing a program to create a table so that I can have a consistent view of certain values in a workfile. I've figured out how to show the level of series in this simple table using @elem to refer to each month's value, but I would also like to be able to show the percentage change from the prior year. I run into difficulty with the line "mytab(!row,!col) = @elem(@pcy(y), %k)", because "@PCY is an illegal or reserved name".

I recognize that one work around is to create a series that is the percentage change from the prior year, and then insert that in the table, and then delete it. But I was curious if there was less complicated solution.

By the way, are there any examples of programs that create simple tables, I'm sure I have much to learn?

I'm using Eviews 7.2. A sample of the program follows.

Code: Select all

workfile work m 1987.1 2012.12 series y = @trend table mytab !row=1 !col=2 %yr = @str(2012) for !x=1 to 12 %k = %yr + "m" + @str({!x}) mytab(!row,!col) = %k !col = !col +1 next !row = !row + 1 mytab(!row,1) = "y" !col=2 for !x=1 to 12 %k = %yr + "m" + @str({!x}) mytab(!row,!col) = @elem(y, %k) !col = !col +1 next !row = !row + 1 mytab(!row,1) = "@pcy(y)" !col=2 for !x=1 to 12 %k = %yr + "m" + @str({!x}) mytab(!row,!col) = @elem(@pcy(y), %k) !col = !col +1 next

Re: Creating a table with @pcy in a row

Posted: Wed Dec 12, 2012 1:56 pm
by EViews Gareth
The way you describe is, probably, the best way to do it.

You might also try just using the freeze command to freeze the spreadsheet view of the series (or, if you want a group containing the series and the @pch of the series), and then using the table.copyrange command to copy the whole lot in one go.