Copy Command Options

For questions regarding programming in the EViews programming language.

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

modelmaker
Posts: 10
Joined: Fri Apr 08, 2011 7:47 am

Copy Command Options

Postby modelmaker » Tue Jun 07, 2011 9:00 am

I have two questions regarding the 'copy' command:
(1) When I copy series between pages, the 'link' option doesn't appear to work:

Code: Select all

copy(link) annual\series1 quarterly\series1
(2) I am having trouble getting the 'smpl' option to work. The copy command seems to automatically merge any available data within the workfile range:

Code: Select all

copy(m,smpl="1970 2009") db1::series2 wf::series2
Thanks.

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

Re: Copy Command Options

Postby EViews Gareth » Tue Jun 07, 2011 9:07 am

The link option is for creating database links, not links between pages. Use a link object if you want to create a link between two pages.

I'm not sure if the smpl option works when copying from a database.

modelmaker
Posts: 10
Joined: Fri Apr 08, 2011 7:47 am

Re: Copy Command Options

Postby modelmaker » Wed Jun 08, 2011 11:26 am

With regard to the "smpl" option, I tried the following code:

Code: Select all

series series1 fetch(c=nu,d=db1) series2 copy(m,smpl="1971Q1 1990Q4") wf::series2 wf::series1
Even when copying within the same workfile page, the "smpl" option doesn't seem to work. Everything in series2 gets copied into series1. Any suggestions?

(Forgot to mention - I'm using EViews 7 Enterprise Edition.)

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

Re: Copy Command Options

Postby EViews Gareth » Wed Jun 08, 2011 11:37 am

Seems to work for me:

Code: Select all

wfcreate(page=page1) m 1990 2010 series y=nrnd pagecreate(page=page2) m 1990 2010 copy(smpl="1993 1995") page1\y page2\y show y

modelmaker
Posts: 10
Joined: Fri Apr 08, 2011 7:47 am

Re: Copy Command Options

Postby modelmaker » Wed Jun 08, 2011 12:30 pm

Your code works, but why doesn't this code work?:

Code: Select all

wfcreate(page=page1) m 1990 2010 series y=db::lr series z copy(m,smpl="1993 1995") y z show z

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

Re: Copy Command Options

Postby EViews Gareth » Wed Jun 08, 2011 1:13 pm

The copy command isn't really meant for copying series into the same page. You can use simple = assignment to do that:

Code: Select all

smpl 1993 1995 series z = y


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests