Hi:
Stored processes (SP) execute on either the workspace server or the stored process server. Neither of those servers has any visibility of an EG session's libnames. Usually, an SP contains libnames for data where the libnames are assigned in the metadata OR that you point to INSIDE the stored process with a LIBNAME statement. (You can also use references to libnames like SASHELP -- where the metadata has been told that these libnames are automatically assigned.)
For example, if you point to data that is registered on the BI Platform and you generate and EG task and then you use the Stored Process Wizard to turn that task into a Stored Process -- somehow the LIBNAME must be dealt with -- if the LIBNAME is automatically assigned and known to the metadata server -- then the stored process wizard will tell you that no LIBNAME is necessary; but, otherwise, EG's SP Wizard has a separate step to make sure that the SP code has a LIBNAME statement -- inside the SP code.
You have 3 choices for dealing with LIBNAMES in stored processes
1) Inside your SP, use a LIBNAME statement with the META engine (and get all the security (read/write/delete controls), etc -- this does mean the library must be registered in the metadata) or
2) Inside your SP, don't use the META engine, but use a LIBNAME statement with the physical server path for the data (in which case, you essentially bypass a lot of the benefits of the metadata, including the read/write/delete controls.) or
3) Register your library and tables in the metadata (using either DI Studio or SAS Management Console) and select the advanced option that the library is automatically assigned or automatically initialized when the server session starts -- this means you would not need a LIBNAME statement inside the SP. Thus, your LIBNAME would become just like SASHELP -- automatically assigned.
Note that none of these 3 options allow for operation as you describe, where MYLIB is picked by the user in the EG session and then the SP uses MYLIB from the EG session, without MYLIB being registered in the metadata.
Your design of dragging and dropping the SPs in an EG project sounds interesting. Without seeing ALL the code involved, it is hard to speculate on how you might change your concept or your code a bit to make things work. It almost sounds to me like you're combining some features of autocall macros or %INCLUDE or custom tasks or code nodes with Stored Processes.
Your best resource on how data access works on the BI Platform is to read the Platform Administration Guide about data:
http://support.sas.com/documentation/configuration/bicag.pdf
You might also consider contacting Tech Support for more help with the overall design of what you are trying to do or with specific suggestions for how to make your Stored Processes flexible with regard to different users' libraries. Also, keep in mind that if each of your stored processes is a "stand-alone" stored process with separate
%STPBEGIN/%STPEND statements, then the WORK library from one stored process will not be available to a subsequent stored process unless you do something to explicitly persist the session on the server.
cynthia