Hello All -
I am a newcomer to REXX and am in the process of writing a simple REXX procedure which reads a list of files which shall be copied over as tape files, making a copy of the file in tape format as each file name gets read.
I am using DFSORT/ICETOOL to effect the copying over to tape format. The problem is that it doesn't work even though I find no errors in TOOLMSG and DFSMSG and get a RC=00. The new (copied) file is not allocated.
In the course of testrunning I have discovered that when the SORTOUT data exists as part of JCL code (the REXX being invoked from IKJEFT01), then the new (copied) file DOES get allocated (see under):
But when the COPYOUT DD data (as seen above) takes the form of a record in a file (placed there by REXX), then no new file is copied even though RC = 00 (see under)
Here the file data takes the form of a single line/record with all the file allocation data as shown in the first example followed by a blank line/record (a NULL record in REXX which signals EOF).
I need the COPYOUT data as a file instead of as JCL DD data because the REXX inserts this COPYOUT data into the file after each file name is read prior to running the ICESORT copy process.
I am willing to run the REXX from a JCL, though I would prefer to invoke it from TSO or ISPF.
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
Quote:
But when the COPYOUT DD data (as seen above) takes the form of a record in a file (placed there by REXX), then no new file is copied even though RC = 00 (see under)
Your process is not clearly explained. Are the DD statements part of the submitted JCL or not? If they are part of a different file, then they will not be considered part of the JCL and will not get 'executed' when the job is submitted.
Hello Pedro and Enrico-S -
Sorry about the lack of detail in my explanation, my employer does not allow the copy of data, pics etc. from work environment to public internet and vice-versa.
I must log on privately to show an example. Here is an example of what DOES NOT WORK:
Enrico-S: So in these examples the REXX is invoked from IKJEFT01. The REXX in turn invokes the DFSORT/ICETOOL. My plan is that the file defined in COPYOUTwill be changed every time the REXX list-read loop is incremented by one.
Is it possible to generate a new JCL COPYOUT DD statement via REXX? Wouldn't I basically have to generate a new job via REXX (and then run it) for every file on the list to be copied ?
Pedro: Your statement agrees with the results I have been getting: that is if my DD statements 'are part of a different file, then they will not be considered part of the JCL and will not get 'executed' when the job is submitted.'
I gather that I would be able to have my DD statements as ICETOOL files and not part of the JCL (and run from TSO/ISPF), but then I would need to have Tape Mount Authority ?
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
Enrico's example shows that allocations in rexx are done through the use of TSO ALLOCATE statements.
The JCL is processed by the system before the program specified on PGM= is called. The rexx or any other program cannot dynamically create other JCL to be run as part of the same step. Except they can use TSO ALLOCATE or dynamic allocation SVC.