Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
If your code works correctly the current dsn will be available - there is no reason to change it. The code would locate the proper dd and return the first dataset name used by that dd (concatenated datasets are an entirely different matter).
Even if you believe there is a reason to change the actual dataset name, you cannot. . .
Why do you believe you should change something that is managed by the operating system, not your code?