Because the topic is so general, I can’t think of a better response than to suggest that you review the Control language (CL) topic in the V5R3 Information Center. Read through the topics on that page and download the CL Programming .PDF at the end of the page.
You might be using a version earlier or later than V5R3, but the features that are missing from earlier releases can all be worked around and the features that are available in V5R4 will make much more sense if you can grasp V5R3 first.
What are you having a problem with? If you don’t know how to program in CL, how did you get tasked with this request?
Hmm… perhaps you can clarify your question: Are you writing a CL program to do something with spooled files or just how to work with them using WRKSPLF. Here is a youtube video on how to do that:http://www.youtube.com/watch?v=CXlm4xJ3WdU
The task sounds simple if all you need to do is accept these 4 variables. What you do with them after is where the core business logic is. If you task it to retrieve these variable from somewhere is a little more involved. What is the full scope of the project from start to finish? With that we maybe able to help you further.