Version 4.2.6 for Mainframes (Update)
 —  Natural Advanced Facilities  —

NAF - NATSPOOL in Batch Mode

This documentcovers the following topics:


General Information

Natural batch jobs can store reports on the spool file.

To do so, specify FSPOOL=(nnnnn,fffff) and the printers to be used by Natural Advanced Facilities with either the NTPRINT macro or the PRINT parameter (see the Natural Parameter Reference documentation).

The reports can subsequently be routed by the operator to remote terminal printers in the same way as those produced by online Natural applications.

In order to use NATSPOOL in batch mode, the NATSPOOL nucleus NAFNUC must be link-edited to the Natural batch module.

The value of *USER is taken as the Sending User ID.

Batch jobs creating reports on the spool file can be submitted offline or online by using the Natural Remote Job Entry function NATRJE described in the Natural Utilities documentation. In this way it is possible to build online Natural applications which transfer time-consuming operations to batch jobs, which in turn spool the output back to the online Natural environment.

Example - z/OS Systems

//SYSIN    DD  *   
 INCLUDE NATLIB(NATOS) 
 INCLUDE NATLIB(NATCONFG)
 INCLUDE NATLIB(NATSTUB) 
 INCLUDE NATLIB(NATURAL) 
 INCLUDE NATLIB(NATTEXT) 
 INCLUDE NATLIB(NATTXT2)
 INCLUDE NATLIB(NATTXT3) 
 INCLUDE NATLIB(NATPARM) 
 INCLUDE NAFLIB(NAFNUC)         NATSPOOL Nucleus
 INCLUDE ADALIB(ADAUSER) 
 ENTRY CMSTART
 NAME  NATBATCH(R)

Using the above batch module, the following sample z/OS execution JCL allows NATBATCH to store reports on the spool file.

//TEST     JOB  NATSPOOL,CLASS=G,MSGCLASS=X                              
//BATCH    EXEC PGM=NATBATCH,PARM='PRINT=((1),AM=STD),PRINT=((2),AM=NAF)'
//STEPLIB  DD   DSN=NATURAL.NAF.LOAD,DISP=SHR                        
//         DD   DSN=ADABAS.LOAD,DISP=SHR                            
//DDCARD   DD   DSN=NATURAL.SOURCE(ADAPARM),DISP=SHR                 
//CMPRINT  DD   SYSOUT=X                                                 
//CMPRT01  DD   SYSOUT=X                                                 
//CMSYNIN  DD   *                                                        
LOGON TEST                                                               
CREATE                                                                   
WRITE (1) 'This report is for CMPRT01'                                   
WRITE (2) 'This report is for NATSPOOL'                                  
END                                                                      
RUN                                                                      
FIN                                                                      
/*

Example - z/VSE Systems

//JOB Natural                                                            
//EXEC PROC=NATLIB                                                       
//EXEC PROC=NAFLIB                                                       
//EXEC PROC=ADALIB                                                       
 PHASE NATBATCH                                                          
 INCLUDE NATLIB(NATDOS)                                                  
 INCLUDE NATLIB(NATCONFG)                                                
 INCLUDE NATLIB(NATSTUB)                                                 
 INCLUDE NATLIB(NATURAL)                                                 
 INCLUDE NATLIB(NATTEXT)                                                 
 INCLUDE NATLIB(NATTXT2)
 INCLUDE NATLIB(NATTXT3)                                                 
 INCLUDE NATLIB(NATPARM)                                                 
 INCLUDE NAFLIB(NAFNUC)         NATSPOOL Nucleus
 INCLUDE ADALIB(ADAUSER)                                                 
 ENTRY CMSTART

Using the above batch module, the following sample z/VSE execution JCL allows NATBATCH to store reports on the spool file.

// JOB TEST                                                              
// OPTION LOG
// EXEC PROC=NAFLIB                                                      
// EXEC PROC=ADALIB                                                      
// LIBDEF PHASE,SEARCH=(SAGLIB.NAFvrs),TEMP
// ASSGN SYS010,00E                                                      
// ASSGN SYS000,READER                                                   
// EXEC NATBATCH,SIZE=NATBATCH,PARM='SYSRDR'
PRINT=((1),AM=STD,SYSNR=10,LRECL=133)
PRINT=((2),AM=NAF)
/*                                                                       
ADARUN                                                                   
/*                                                                       
LOGON TEST                                                               
CREATE                                                                   
WRITE (1) 'This report is for CMPRT01'                                   
WRITE (2) 'This report is for NATSPOOL'                                  
END                                                                      
RUN                                                                      
FIN                                                                      
/*

Example - BS2000/OSD Systems

The following sample BS2000/OSD execution JCL allows NATBATCH to store reports on the spool file.

/LOGON
/FILE LI.PRINTFILE.1,LINK=P01
/EXEC NATBATCH
LOGON TEST
CREATE
WRITE (1) 'THIS REPORT IS FOR PRINTFILE 1'
WRITE (2) 'THIS REPORT IS FOR NATSPOOL'
END
RUN
FIN
/LOGOFF

Top of page

NATSPOOL in Batch Mode with CICS or IMS TM

The NATSPOOL spool server under CICS or IMS TM is not started by batch jobs. This means that in general, reports created in batch mode are not printed automatically on CICS or IMS TM terminal printers. However, if the spool server is already active, reports that are created in batch mode are also printed if they have the same Destination/Form as the report which has ONPR status.

If the spool file is an Adabas file, NATSPOOL can be invoked under CICS or IMS TM and in batch mode concurrently.

Note:
For CICS usage: If the spool file is a VSAM dataset, creation of reports in batch mode is only possible if control has not been given to CICS that is, CICS has not opened the spool file for update. This restriction is due to VSAM provisions for controlling data sharing in a single-system environment (SHARE OPTION).

Top of page

NATSPOOL in Batch Mode with BS2000/OSD

The spool server must be active during a batch run. When a Natural program which creates a report is started, the report is written to the spool file, the spool server is activated, and the report is printed. NATSPOOL operates in batch mode the same way as it operates online.

Top of page