wfcreate

For questions regarding programming in the EViews programming language.

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

bhaupt
Posts: 25
Joined: Fri May 07, 2010 1:16 pm

wfcreate

Postby bhaupt » Tue May 25, 2010 2:17 pm

I am running eviews 7.1 and I am up to date with updates.


I have a header file in which I specify a path, the forecast version, and (ideally) the number of datalines being read in from an excel sheet.

If I explicitly specify 43787 unstructured lines as in: (Case 1: this works)

Code: Select all

wfcreate(wf={%netpath}\test\raw_fcst_{%cur_ver}.wf1,page=Raw) u 43787
the workfile creates without a hitch; however, if I attempt to include the number of lines in my header file as

Code: Select all

'# Current & Previous Forecasts %cur_ver="0510" !cur_vlen = 43787 'length of datafile
when I execute the wfcreate command I get an Illegal Date error: (Case 2: this fails)

Code: Select all

wfcreate(wf={%netpath}\test\raw_fcst_{%cur_ver}.wf1,page=Raw) u !cur_vlen
My include statement is called beforehand. The program runs with no errors if I specifcy the 43787 as the number of observations.

I have tested at the command line and the illegal date error occurs again, however in the popup, it says !cur_vlen in the number of observations field, meaning it seems to take it as a string literal instead of as a numeric variable I was hoping it would think it should be.

Is it a Bug, a feature, or am I doing it wrong?

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

Re: wfcreate

Postby EViews Gareth » Tue May 25, 2010 2:21 pm

Not sure I exactly follow what you're asking. But I just did the following steps, and it worked fine. I think it is what you are trying to do.

I created a program file called "DEFAULTS.PRG". In that file there is a single line:

Code: Select all

!n=100
I then create another program and in it are the lines:

Code: Select all

include default.prg wfcreate u !n
And that worked perfectly.

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

Re: wfcreate

Postby EViews Gareth » Tue May 25, 2010 2:21 pm

Not sure I exactly follow what you're asking. But I just did the following steps, and it worked fine. I think it is what you are trying to do.

I created a program file called "DEFAULTS.PRG". In that file there is a single line:

Code: Select all

!n=100
I then create another program and in it are the lines:

Code: Select all

include default.prg wfcreate u !n
And that worked perfectly.

bhaupt
Posts: 25
Joined: Fri May 07, 2010 1:16 pm

Re: wfcreate

Postby bhaupt » Wed May 26, 2010 6:24 am

I'll try it again...

followup edit:
I changed my variable name to !n rewrote the line and, yes, it worked properly. I then reconstructed the line and it failed. I then rewrote the line and it worked. I don't have an explanation, but I do have a working program.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests