🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-30-2017 06:23 AM
(1110 views)
%macro test(s_no=
,libname1 =
,libname2 =
,libname3 =
,libname4 =
);
libname inputt "&libname1";
libname interim "&libname2";
libname output "&libname3";
libname dataa "&libname4 ";
%mend test;
%test(
s_no=1234;
,libname1 = C:\Users\abc\Desktop\input;
,libname2 = C:\Users\abc\Desktop\interim;
,libname3 = C:\Users\abc\Desktop\output;
,libname4 =C:\Users\abc\Desktop\test;
);
I am getting
Note: Library doesn't exist error while running this code. Please let me know what am I doing wrong.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Drop the semicolons in your arguments like this
%macro test(s_no=
,libname1 =
,libname2 =
,libname3 =
,libname4 =
);
libname inputt "&libname1";
libname interim "&libname2";
libname output "&libname3";
libname dataa "&libname4 ";
%mend test;
%test(
s_no = 1234
,libname1 = C:\Users\abc\Desktop\input
,libname2 = C:\Users\abc\Desktop\interim
,libname3 = C:\Users\abc\Desktop\output
,libname4 = C:\Users\abc\Desktop\test
);
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Drop the semicolons in your arguments like this
%macro test(s_no=
,libname1 =
,libname2 =
,libname3 =
,libname4 =
);
libname inputt "&libname1";
libname interim "&libname2";
libname output "&libname3";
libname dataa "&libname4 ";
%mend test;
%test(
s_no = 1234
,libname1 = C:\Users\abc\Desktop\input
,libname2 = C:\Users\abc\Desktop\interim
,libname3 = C:\Users\abc\Desktop\output
,libname4 = C:\Users\abc\Desktop\test
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Omit the semicolons after the macro parameters. Those semicolons otherwise end up as part of the directory names.
%macro test(s_no=
,libname1 =
,libname2 =
,libname3 =
,libname4 =
);
libname inputt "&libname1";
libname interim "&libname2";
libname output "&libname3";
libname dataa "&libname4";
%mend test;
%test(
s_no=1234
,libname1 = C:\Users\abc\Desktop\input
,libname2 = C:\Users\abc\Desktop\interim
,libname3 = C:\Users\abc\Desktop\output
,libname4 =C:\Users\abc\Desktop\test
);