how to run multiple program in one program?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: how to run multiple program in one program?
Oh i thought i had, this is how i currently have it:
exec "C:\documents\test1\file1_jpy.prg"
%str = @datestr(@now, "yyyy-mm-dd" )
wfsave "C:\documents\test1\jpy1_" + %str +".wf1"
exec "C:\documents\test1\file1_jpy.prg"
%str = @datestr(@now, "yyyy-mm-dd" )
wfsave "C:\documents\test1\jpy1_" + %str +".wf1"
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to run multiple program in one program?
Code: Select all
%str = @datestr(@now, "yyyy-mm-dd" )
%filename = "C:\documents\test1\jpy1_" + %str +".wf1"
wfsave %filename
Re: how to run multiple program in one program?
thank you very much Gareth :)
Re: how to run multiple program in one program?
Hi Gareth,
I have an eviews workfile that computes a number of matrices. The workfile will be run everyday, so it will be date stamped. Everyday I would like to then save the matrices to an excel file, can you point me in the right direction of how to code this (I have no idea where to start!). I thought I could just go to addins in excel and do 'get data' and choose the workfile and then which matrices I want...,but the issue is that the workfile name will change each day as it is time stamped, so I would have to manually point to the correct workfile (and therefore matrices) each day....
Thanks!
I have an eviews workfile that computes a number of matrices. The workfile will be run everyday, so it will be date stamped. Everyday I would like to then save the matrices to an excel file, can you point me in the right direction of how to code this (I have no idea where to start!). I thought I could just go to addins in excel and do 'get data' and choose the workfile and then which matrices I want...,but the issue is that the workfile name will change each day as it is time stamped, so I would have to manually point to the correct workfile (and therefore matrices) each day....
Thanks!
Re: how to run multiple program in one program?
And one more question please!:
I have the following code (see below). But it stops after the first run (ie it runs the usd program and doesn't go onto eur). How can i make it go onto the next program? Thank you
------------------------------------------------------------------
%my_startdate_usd = "31/07/2000"
%my_startdate_eur = "31/07/2004"
%my_startdate_gbp = "31/07/2000"
%my_enddate = "11/12/2015"
%str = @datestr(@now, "yyyy-mm-dd" )
%filename1 = "C:\documents\test1\usd_" + %str +".wf1"
%filename2 = "C:\documents\test1\eur_" + %str +".wf1"
'%filename3 = "C:\documents\test1\gbp_" + %str +".wf1"
run "C:\documents\test1\usd _rolling.prg"
wfsave %filename1
wfclose %filename1
run "C:\documents\test1\eur_rolling.prg"
wfsave %filename2
wfclose %filename2
run "C:\documents\test1\gbp_rolling.prg"
wfsave %filename3
wfclose %filename3
I have the following code (see below). But it stops after the first run (ie it runs the usd program and doesn't go onto eur). How can i make it go onto the next program? Thank you
------------------------------------------------------------------
%my_startdate_usd = "31/07/2000"
%my_startdate_eur = "31/07/2004"
%my_startdate_gbp = "31/07/2000"
%my_enddate = "11/12/2015"
%str = @datestr(@now, "yyyy-mm-dd" )
%filename1 = "C:\documents\test1\usd_" + %str +".wf1"
%filename2 = "C:\documents\test1\eur_" + %str +".wf1"
'%filename3 = "C:\documents\test1\gbp_" + %str +".wf1"
run "C:\documents\test1\usd _rolling.prg"
wfsave %filename1
wfclose %filename1
run "C:\documents\test1\eur_rolling.prg"
wfsave %filename2
wfclose %filename2
run "C:\documents\test1\gbp_rolling.prg"
wfsave %filename3
wfclose %filename3
Re: how to run multiple program in one program?
i know i need to use the exec function, but I don't know how to pass in the startdate, enddate,and filename.... I basically don't know how to tweak the above code to use exec
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to run multiple program in one program?
Just replace run with exec
Re: how to run multiple program in one program?
But when i do that replacement the 'workfile create' box pops up asking me to input a start and end date....it didn't pop up before
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to run multiple program in one program?
You need to use program arguments or options to pass the filename on
Re: how to run multiple program in one program?
I don't get why it's prompting me to input a start and end date directly into the workfile creation box when I have the start date and end dates in the program file. Any thing at all you can say Gareth would be so helpful! (defo going around in circles!)
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to run multiple program in one program?
As far as I can see, you're not passing on the start/end date to the child programs, so the box pops up asking you for one.
Re: how to run multiple program in one program?
Oh the child programs are the following:
"C:\documents\test1\usd _rolling.prg"
"C:\documents\test1\eur_rolling.prg"
"C:\documents\test1\gbp_rolling.prg"
And at the top of each child program is the following:
wfcreate {%filename1} d5 {%my_startdate_usd} {%my_enddate}
where %filename1 is for the usd program, %filename2 is for the eur program and %filename3 is for the gbp program...
At the top of the master file i put:
%my_startdate_usd = "31/07/2000"
%my_startdate_eur = "31/07/2004"
%my_startdate_gbp = "31/07/2000"
%my_enddate = "11/12/2015"
%str = @datestr(@now, "yyyy-mm-dd" )
%filename1 = "C:\documents\test1\usd_" + %str +".wf1"
%filename2 = "C:\documents\test1\eur_" + %str +".wf1"
'%filename3 = "C:\documents\test1\gbp_" + %str +".wf1"
So this is where i am pulling in the inputs for the child programs.... Is that wrong?
"C:\documents\test1\usd _rolling.prg"
"C:\documents\test1\eur_rolling.prg"
"C:\documents\test1\gbp_rolling.prg"
And at the top of each child program is the following:
wfcreate {%filename1} d5 {%my_startdate_usd} {%my_enddate}
where %filename1 is for the usd program, %filename2 is for the eur program and %filename3 is for the gbp program...
At the top of the master file i put:
%my_startdate_usd = "31/07/2000"
%my_startdate_eur = "31/07/2004"
%my_startdate_gbp = "31/07/2000"
%my_enddate = "11/12/2015"
%str = @datestr(@now, "yyyy-mm-dd" )
%filename1 = "C:\documents\test1\usd_" + %str +".wf1"
%filename2 = "C:\documents\test1\eur_" + %str +".wf1"
'%filename3 = "C:\documents\test1\gbp_" + %str +".wf1"
So this is where i am pulling in the inputs for the child programs.... Is that wrong?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to run multiple program in one program?
Yes, you're not using arguments or options.
Re: how to run multiple program in one program?
oh i thought i was,sorry - it worked with the run command.... ie it took the start dates and end dates from the master file as inputs into the child file.. Could you give me a short example please, so that I can see where i am going wrong. Sorry I've never done this before, so I am confused.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to run multiple program in one program?
returns the current date as a string.Code: Select all
@datestr(@now, "yyyy-mm-dd")
To pass information onto child programs you'll want to use program arguments or program options.
Who is online
Users browsing this forum: No registered users and 2 guests
