I did not get your point. If your "retreivedata.sas creates a table" then you simply use this name in the following datastep:
if cat in ('specialty', 'lines') then cat = 'other';
With SAS system, you have some options like using a SAS view to generate a file and then reference the file in a subsequent DATA step, for example.
Also, if you use the SET statement and supply no specific input, SAS will default to the prior SAS member/file created in the same SAS session.
Also, if you wish to specify a SAS file to create and then in a subsequent input using a SET, then consider using a SAS MACRO variable to list the "passed" file name information, where it would be defined with a %LET statement, referenced on a DATA statement using the associated macro variable syntax, and then again later referenced, as needed, again with the macro variable syntax.
Otherwise, it's not really clear exactly what you are trying to accomplish and how to recommend an approach, without more specific detailed information.
Interesting number of alternative interpretations of this question!
To add to the variety, I had assumed the names of the programs to be executed were in a variable of a metadata table. Then
CALL EXECUTE( '%include ' !! Quote( Cats( path, ProgName )) !! " ;" );
might do what is needed.
I actually work the problem out a different way. I have three different programs that rely on the output of the the previous program.
so what I was trying to do is have the first programs executed the code from another programs to create a table in current program then send the results to another program for execution
here is how i fixed; in the first program i had an include statement to get code from another program in the second program I have an include first program in the third program i included code again from another program and include second program and I am now working witht the data.
I think there is an easier way but this works for now so thanks for the help