NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 characters, a

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 characters, a

I am getting a note in the log

"NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 characters, and will be truncated."

when I run the below macro

 

%cr_root_sub_dir(maindir='~/practice_exer/Mth_Rep',subdir='APR2016');

 

The macro code is :

 

%macro cr_root_sub_dir(maindir,subdir);
 %put _local_;
 %if &maindir = %then
   %do;
     %put 'Root directory is blank';
     %goto exit;
   %end;
 %else
   %do;
      %if %sysfunc(fexist(&maindir)) %then
         %put 'Directory &maindir Already Exists';
      %else
         %do;
            %let newdir = %sysfunc(dcreate(&maindir,'~'));
            %let newsubdir = %sysfunc(dcreate(&subdir,&maindir));
        %end;
    %end;
%exit:;
%mend cr_root_sub_dir;

 

 

 


Accepted Solutions
Solution
‎04-10-2016 11:11 AM
Super Contributor
Posts: 406

Re: NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 character

@pambardar I hope this worked for you. In any case please let me know and  please consider accepting my solution.

 

- Jan.

View solution in original post


All Replies
Super Contributor
Posts: 406

Re: NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 character

fexist() takes a fileref as argument. What you provieded was a filename. Assign a fileref using filename statement or use filexist() instead of fexist().

 

Regards,

- Jan.

Super Contributor
Posts: 406

Re: NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 character

I meant FILEEXiST() of course. Two e's. 

Solution
‎04-10-2016 11:11 AM
Super Contributor
Posts: 406

Re: NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 character

@pambardar I hope this worked for you. In any case please let me know and  please consider accepting my solution.

 

- Jan.

New Contributor
Posts: 4

Re: NOTE: In a call to the FEXIST routine, the fileref '~/practice_exer/Mth_Rep' exceeds 8 character

Thanks. I tried with assigning fileref and it worked.
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 509 views
  • 7 likes
  • 2 in conversation