Sending JCL files with an embedded command

BARR/SPOOL

Using embedded commands adds flexibility to the existing BARR/RJE and BARR/NJE functionality. BARR/TRAN provides extended file transfer capabilities, including longer record length, variable length records, and so on.

You can send ASCII-format files to the host by including the send command in a JCL file. The embedded send files command is the double number sign (##). BARR/SPOOL treats the text specified after the ## as if you submitted another file to the spool. You can specify more than one ## statement on a single line (separated by a single space) or on multiple lines; however, the JCL file cannot include any other data. If any of the included files are missing, then no data will be sent.

Include the full file directory path in the embedded command A command placed in a text, graphics, or other document file, often used for printing or page-layout instructions. If the directory path contains spaces, enclose the path in quotation marks (for example, ##"C:\DATA FILES\FILE1"/B). To ignore ## processing for a particular line, add a /1 switch to the end of the line (for example, ##C:\DATA\FILE1/1).

See also:


Barr File Transfer (BFT) send mode

To use the Barr File Transfer (BFT) send mode, you must install the BARR/TRAN software on the mainframe. When files are sent to the host, BARR/TRAN will process the embedded commands. The following example shows you how to send a JCL file and a data file by using the embedded send files command and the BFT send mode.

If a parameter is not specified, /A send mode is used.

//JOBNAME JOB (1010,333,777),BARR
// EXEC PGM=IEBGENER
//SYSOUT DD SYSOUT=A
//SYSUT2 DD SYSOUT=A
//SYSUT1 DD *
##C:\DATA\FILE3/Tn
/*
//

  1. In the JCL file, enter the embedded send files command with the appropriate /Tn send mode. You can choose any of the following options.

Mode

File Type

Description

TP

Printer data in ASCII

TP record format describes a print file. It contains printable characters of varying length lines. Each line is terminated by a carriage return (CR), which can be followed by line feed (LF) and form feed (FF) characters. This popular format is used by all microcomputer and minicomputer operating systems.

TA

ASCII file with no record structure

This file does not contain any record delimiters such as line feed (LF) and form feed (FF) characters.

TFn

Fixed-length ASCII records

TFn records contain ASCII printable characters and have a fixed length of n. There are no delimiters between the records. This file might not be printable because there are no CR or LF characters to advance the printer to a new line.

TDFn

Fixed-length ASCII records with delimiters

TDFn records contain ASCII printable characters and have a fixed length of n. Each record is terminated with a CR LF. A file in TDFn format can be printed, provided that the length of the record n is not greater than the printer’s carriage width.

TV

Variable-length ASCII records with delimiters

Each record is terminated with a CR LF. A file in TV format can be printed, provided that the maximum length of the record is not greater than the printer’s carriage width.

TB

Binary data with no record structure

TB format is an unstructured file without ASCII or EBCDIC code structure or record structure. The only attribute transferred with the file is the file length.

TBFn

Fixed-length binary records

TBFn contains binary records without ASCII or EBCDIC code structure that have a fixed length of n.

TBV

Variable-length binary records

A file in TBV format begins with a four-byte header of 76 1A LSB MSB, where LSB and MSB represent the maximum record length expressed in binary with the least significant byte first. Additionally, each record in the file must begin and end with its binary length count. If the maximum record length in the header is less than 255, the record length code is one byte. Otherwise, it is two bytes, with the least significant byte given first.

  1. Send the JCL file to BARR/SPOOL. BARR/SPOOL interprets the embedded send command and sends the FILE3 file in the \\Data folder with the JCL. As BARR/SPOOL sends the JCL and DATA files, it converts them to the Barr File Transfer format.

When using the Barr Jobs to Mainframe driver, the data files must be located in the \\Winnt\System32 folder or a subfolder.

Binary send mode

This example shows you how to send a JCL file and a data file by using the embedded send files command and the Binary (B) send mode.

If a parameter is not specified, /A send mode is used.

//JOBNAME JOB (1010,333,777),BARR
// EXEC PGM=IEBGENER

//SYSOUT DD SYSOUT=A

//SYSUT2 DD SYSOUT=A

//SYSUT1 DD *

##C:\DATA\FILE2/B

/*

//

  1. In the JCL file, enter the embedded send files command with the /B send mode.

  1. Send the JCL file to BARR/SPOOL. BARR/SPOOL interprets the embedded send command and sends the FILE2 file in the \\Data folder as a binary file with the JCL.

When using the Barr Jobs to Mainframe driver, the data files must be located in the \\Winnt\System32 folder or a subfolder.

ASCII send mode

This example shows you how to send a JCL file and a data file by using the embedded send files command and the ASCII (A) default send mode.

If a parameter is not specified, /A send mode is used.

//JOBNAME JOB (1010,333,777),BARR
// EXEC PGM=IEBGENER

//SYSOUT DD SYSOUT=A

//SYSUT2 DD SYSOUT=A

//SYSUT1 DD *

##C:\DATA\FILE1/A

/*

//

  1. In the JCL file, enter the embedded send files command with the /A send mode.

You can use the /An format, where n is the record length. The record length value can vary from 1 to 255.

  1. Send the JCL file to BARR/SPOOL. BARR/SPOOL interprets the embedded send command and sends the FILE1 file in the \\Data folder with the JCL. As BARR/SPOOL sends the JCL and DATA files, it converts them from ASCII to EBCDIC.

When using the Barr Jobs to Mainframe driver, the data files must be located in the \\Winnt\System32 folder or a subfolder.

Variable ASCII send mode

This example shows you how to send a JCL file and a data file by using the embedded send files command and the variable ASCII (V) send mode. When using the variable ASCII send mode, each ASCII line is sent as one or more 80-character lines. You can use this send mode to send files that contain variable-length lines or lines with more than or less than 80 characters. BARR/RJE adds a vertical bar to signal the end of the original record. You must use a program at the host to rebuild the lines into their original records.

If a parameter is not specified, /A send mode is used.

//JOBNAME JOB (1010,333,777),BARR
// EXEC PGM=IEBGENER

//SYSOUT DD SYSOUT=A

//SYSUT2 DD SYSOUT=A

//SYSUT1 DD *

##C:\DATA\FILE1/V

/*

//

  1. In the JCL file, enter the embedded send files command with the /V send mode.

  1. Send the JCL file to BARR/SPOOL. BARR/SPOOL interprets the embedded send command and sends the FILE1 file in the \\Data folder with the JCL. As BARR/SPOOL sends the JCL and DATA files, it converts them from ASCII to EBCDIC.

When using the Barr Jobs to Mainframe driver, the data files must be located in the \\Winnt\System32 folder or a subfolder.