I think this https://www.lexjansen.com/nesug/nesug07/po/po13.pdf may get you started.
Bascially the idea is using a SAS Macro variable, the bits in SAS that look like &YR1 and &YR2 and then supply the values on a JCL RUN statement.
Note that you will want to look up the rules involved in valid SAS Macro variables (reference starts with & followed by letters, digits or _ character ) and that they will only resolve inside double quotes if the value needs to have quotes when used.
So instead of RT&&0 you might use a macro variable &RT that would be defined to have the value ABCD. To suffix the value with a 0 you would use &RT.0 in the SAS code as the . tells SAS where the end of the macro variable name is so doesn't go looking for a longer variable name.
So this code:
if substr(jobname, 1, 5) = 'RT&&0' then output rip;
else if substr(jobname, 1, 5) = 'RT&&G' then output sysgen;
else if substr(jobname, 1, 6) = 'RT&&MN' then output maint;
run;
Might be come
if substr(jobname, 1, 5) = "&RT.0" then output rip;
else if substr(jobname, 1, 5) = "&RT.G" then output sysgen;
else if substr(jobname, 1, 6) = "&RT.MN" then output maint;
run;
And the call might look something like
//RUN1 EXEC YOURPROG,RT=ABCD
In my case, I haven't written a JCL SAS program since 1991 so made a guess for a google search using SAS JCL PARMBUFF (as parmbuff is one of the things I vaguely remembered using related to this)