below is the code you may require...i know its late....but felt to send this to you.
CICS provides a programming interface to JES that allows CICS applications to create and retrieve spool files.
The interface consists of five commands:
1) SPOOLOPEN INPUT, which opens a file for input
2) SPOOLOPEN OUTPUT, which opens a file for output
3) SPOOLREAD, which retrieves the next record from an input file
4) SPOOLWRITE, which adds one record to an output file
5) SPOOLCLOSE, which closes the file and releases it for subsequent processing by JES
05 FILLER PIC X(14) VALUE 'WRITER(MYPROG)'.
To create an output spool file, a task starts by issuing a SPOOLOPEN OUTPUT command.
The NODE and USERID options on the command tell JES what to do with the file when it is complete.
You can also use this parameter to specify that your output is written to the MVS internal reader. To use SPOOLXXX commands for this purpose, specify USERID(“INTRDR”) and also use an explicit node name. Do not use NODE('*'). INTRDR is an IBM-reserved name identifying the internal reader.
If you specify USERID(“INTRDR”), the output records written by your SPOOLWRITE commands must be JCL statements, starting with a JOB statement.
Also ensure that you specify the NOCC option on the SPOOLOPEN command. The system places your output records for the internal reader into a buffer in your address space. When this buffer is full, JES places the contents on the spool; later, JES retrieves the job from the spool.
CICS returns an identifier for the file to the task by the TOKEN option of the same command.
Thereafter, the task puts data into the file with SPOOLWRITE commands that specify the token value that was returned on the SPOOLOPEN OUTPUT command. Spool files are sequential; each SPOOLWRITE adds one record to the file. When the file is complete, the task releases the file to JES for delivery or processing by issuing a SPOOLCLOSE with the token that identifies the file.
If you want to the job you submit to execute as soon as possible, you should end your spool file with a record that contains /*EOF in the first five characters. This statement causes JES to release your file for processing, rather than waiting for
other records to fill the current buffer before release.
SPOOLCLOSE, closes the file and releases it for subsequent processing by JES