Hi all.
***********************UPDATED LOG****************************
I am trying to read monthly CSV files into SAS each month. But the macro is not readable in filename statement. Please take a look at the code to see what I am missing.
DATA _NULL_;
tday = INTNX('month',today(),-2,'B');
CALL SYMPUT('chknm',PUT(tday,monyy5.));
RUN;
%put &chknm.;
filename btv1 FTP "/CustomerDelivery/btv/&chknm.._chk2.csv"
host = "&nthost"
user = "&ntid"
And this is the LOG from the code above...
21 %put &chknm.;
JAN18
22
23 filename btv1 FTP "/CustomerDelivery/btv/&chknm.._chk2.csv"
24 host = "&nthost"
25 user = "&ntid"
Thanks!!
So, Which did you submit:
filename btv1 FTP "/CustomerDelivery/btv/&chknm.._chk2.csv"
or (from log)
filename btv1 FTP "/CustomerDelivery/btv&chknm.._chk2.csv"
one of these is not like the other. A missing / would be very critical in finding the file.
Your log is incomplete as you do not show the end of the filename statement or any message about success or failure.
If you want to see the resolved values use
Options mprint;
before the code and then
Options nomprint;
to stop the resolution in the log.
Updated the log. it was with "/"
18 DATA _NULL_;
19 tday = INTNX('month',today(),-2,'B');
20 CALL SYMPUT('chknm',PUT(tday,monyy5.));
21 RUN;
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
user cpu time 0.01 seconds
system cpu time 0.01 seconds
memory 738.15k
OS Memory 19616.00k
Timestamp 03/27/2018 01:42:05 PM
Step Count 12 Switch Count 30
Page Faults 0
Page Reclaims 133
Page Swaps 0
Voluntary Context Switches 111
Involuntary Context Switches 21
Block Input Operations 0
Block Output Operations 0
22 %put &chknm.;
JAN18
23
24 filename btv1 FTP "/CustomerDelivery/btv/&chknm.._chk2.csv"
25 host = "&nthost"
26 user = "&ntid"
27 pass = "&ntpwd"
28 WAIT_MILLISECONDS=1000000;
29
30 Options nomprint;
31
You defined a FILENAME, but you haven't done anything with it yet.
Were you going to try to read that file? Or write to it?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.