Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CICS JES-2 Spool Print

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
vmirani

New User


Joined: 10 Nov 2003
Posts: 1

PostPosted: Mon Nov 10, 2003 8:11 am    Post subject: CICS JES-2 Spool Print
Reply with quote

Can I have a Sample code to print the Spool through a CICS transaction on a JES-2 Environment ??
Back to top
View user's profile Send private message

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Thu Nov 27, 2003 3:34 pm    Post subject:
Reply with quote

Hello vmirani,

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



Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 OUTDES.
   05 FILLER    PIC X(14) VALUE 'WRITER(MYPROG)'.

01 RESP       PIC 9(8) COMP.
01 RESP2       PIC 9(8) COMP.
01 TOKEN       PIC X(8).
01 OUTLEN       PIC S9(8) COMP VALUE +80.

77 OUTPRT       PIC X(80) VALUE 'SPOOLOPEN FUNCTIONING'.

01 PARMSPTR       USAGE IS POINTER.
01 PARMS-POINT       REDEFINES PARMSPTR
         PIC S9(8) COMP.

LINKAGE SECTION.
01 PARMS-AREA.
   03 PARMSLEN    PIC S9(8) COMP.
   03 PARMSINF    PIC X(14).
   03 PARMADDR    PIC S9(8) COMP.

PROCEDURE DIVISION.

EXEC CICS
   GETMAIN SET(ADDRESS OF PARMS-AREA)
   LENGTH(80)
END-EXEC.

SET PARMSPTR       TO ADDRESS OF PARMS-AREA.
MOVE PARMS-POINT    TO PARMADDR.

SET PARMSPTR       TO ADDRESS OF PARMADDR.
MOVE 14       TO PARMSLEN.
MOVE OUTDES       TO PARMSINF.

EXEC CICS SPOOLOPEN OUTPUT
   NODE ('*')
   USERID ('*')
   RESP(RESP)
   RESP2(RESP2)
   OUTDESCR(PARMSPTR)
   TOKEN(TOKEN)
END-EXEC.

EXEC CICS SPOOLWRITE
   FROM(OUTPRT)
   RESP(RESP)
   RESP2(RESP2)
   FLENGTH(OUTLEN)
   TOKEN(TOKEN)
END-EXEC.

EXEC CICS SPOOLCLOSE
   TOKEN(TOKEN)
   RESP(RESP)
   RESP2(RESP2)
END-EXEC.


It is essential to code a GETMAIN command.

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



hope this helps,

Regards

Mayuresh Tendulkar
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us