I believe that datasets are reference type objects. So just pass the dataset to the sub/function.

Another solution here would be to just create a PUBLIC dataset in the module. If your goal is to use this one dataset throughout the whole program then that makes life easier. That said, it's usually not a good idea just to make a bunch of Global variables/objects.