Hello
I am trying to use the command pagesave to save output for a selected range of a workfile. I also need to assign the name of the output file dynamically. The below seems to work in terms of naming the output file, but it does not seem to work if I use %end in the smpl statement (it does work if I hardcode the dates). The error message I get is
Illegal date "8/21/2014 18:48:46" in "PAGESAVE..." (screenshot is attached)
Somehow it seems that @now includes the day and time in this line, but not within the main part of the workfile. The workfile is a dated structured file, monthly frequency, and I used the %end = @datestr(@now) line to set the end of the workfile range and sample.
%end = @datestr(@now)
%a = "output"+@datestr(@now, "yyyymmdd")+".csv"
pagesave %a @keep *real_avg @smpl %end(-24) %end '2012m9 2014m8
Any help would be much appreciated.
Thank you
Setting the smpl in pagesave command
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Setting the smpl in pagesave command
- Attachments
-
- Untitled.png (13.29 KiB) Viewed 2222 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Setting the smpl in pagesave command
It's probably the (-24) that is screwing it up. That isn't a valid date. Use the @dateadd function to take 24 off your date.
Re: Setting the smpl in pagesave command
Thanks - -this worked.
%end = @datestr(@now)
%a = "output"+@datestr(@now, "yyyymmdd")+".csv"
%start = @datestr(@dateadd(@dateval(%end),-24,"mm"))
pagesave %a @keep *real_avg @smpl %start %end
%end = @datestr(@now)
%a = "output"+@datestr(@now, "yyyymmdd")+".csv"
%start = @datestr(@dateadd(@dateval(%end),-24,"mm"))
pagesave %a @keep *real_avg @smpl %start %end
Who is online
Users browsing this forum: No registered users and 1 guest
