If you do not have many folders involved easiest might be a macro variable to hold the main part of the path common to all such as:
%let path=C:\Directory_A\;
libname mylib ("&path.directory_B &path.directory_C &path.directory_D");
of course using appropriate syntax for your operating system and care for letter case if needed.
The last \ is just part of Windows paths. Alternatively if you like you could use
%let path=C:\Directory_A;
libname mylib ("&path.\directory_B &path.\directory_C &path.\directory_D");
The periods are necessary to indicate the end of the macro variable value. Do not insert spaces if not in the in actual path if not there.
&path.\directory_B resolves to "C:\Directory_A\directory_B" &path.\ directory_B would resolve to "C:\Directory_A\ directory_B". One of which is incorrect for your use.
... View more