Send Distribution using JS (SNDDSTJS)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Send Distribution using JS (SNDDSTJS) command allows you to send a spooled file attached to a new distribution message to a recipient or escalation list. The recipient information can be specified explicitly or retrieved from a spooled file.

Note: The graphical user interface must be used to display messages and stop escalation.

Top

Parameters

Keyword Description Choices Notes
RCP Recipient Single values: *NONE, *SPLF, *ONCALL
Other values (up to 50 repetitions): Name
Required, Positional 1
SUBJECT Subject Character value, *NONE Optional
MSG Message Character value, *NONE Optional
ESCALATION Escalation list Character value, *NONE, *RCP Optional
RTNINTNET Return Internet address Character value, *RTNDFT Optional
SPLF Spooled file Name, *NONE Optional
JOB Job name Single values: *
Other values: Qualified job name
Optional
Qualifier 1: Job name Name
Qualifier 2: User Name
Qualifier 3: Number 000000-999999
SPLNBR Spooled fie number Integer, *ONLY, *LAST Optional
PAGERANGE Page range to send Element list Optional
Element 1: Starting page 1-99999999, 1
Element 2: Ending page 1-99999999, *END
SLTTXT Page selection Element list Optional
Element 1: Selection text Character value, *NONE
Element 2: Line number 0-256
Element 3: Starting position 0-256
ATTACH Attachment name Name, *SPLF, *NONE Optional
SUFFIX Attachment suffix Character value, PDF Optional
RMVSPLF Remove spooled file *NO, *YES Optional
TOINTNET Internet address Values (up to 50 repetitions): Character value, *NONE Optional
ADRLOC Address location Element list Optional
Element 1: Line number 0-256, *TEXT
Element 2: Starting position 0-256, *AFTER
Element 3: Length 0-60
Element 4: Text Character value
PGM Exit program Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: Exit program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
Top

Recipient (RCP)

Specifies the recipient to whom you want to send the distribution message.

Note: The graphical user interface must be used to create and update e-mail information for recipients.

This is a required parameter.

Single values

*NONE
There is no recipient specified for the distribution message. An internet address must be specified.
*SPLF
The recipient information is retrieved from the attached spooled file.
*ONCALL
Only recipients that are on-call will receive the message.

Other values (up to 50 repetitions)

name
Specify the name of the recipient. Press F4 when prompting this command to select from a list of existing recipients.
Top

Subject (SUBJECT)

Specifies the subject for the distribution message.

*NONE
There is no subject for the distribution message.
character-value
Specify the subject for the distribution message.
Top

Message (MSG)

Specifies the message text for the distribution message.

Note: Use &N within the message to force the message to a new line.

*NONE
There is no message body for the distribution message.
character-value
Specify the message body for the distribution message.
Top

Escalation list (ESCALATION)

Specifies the escalation list for the distribution message.

Note: The graphical user interface must be used to maintain escalation lists.

*RCP
The escalation list associated with the recipient is used for the distribution message.
*NONE
No escalation list is used for the distribution message.
character-value
Specify the name of the escalation list for the distribution message.
Top

Return Internet address (RTNINTNET)

Specifies the return internet address (i.e. e-mail address) for the distribution message.

*RTNDFT
Use the return internet address specified in the e-mail properties.
character-value
Specify the return e-mail address for the distribution message.
Top

Spooled file (SPLF)

Specifies the spooled file that you want to attach to the distribution message.

Note: Spooled files that contain graphics cannot be used.

*NONE
You do not want to send a spooled file with the distribution message.
name
Specify the name of the spooled file to attach to the distribution message.
Top

Job name (JOB)

Specifies the name of the job that created the spooled file attached to the distribution message.

Single values

*
The job that created the spooled file issued this command.

Qualifier 1: Job name

name
Specify the name of the job that contains the spooled file.

Qualifier 2: User

name
Specify the name of the user from which the spooled file originated.

Qualifier 3: Number

000000-999999
Specify a number between 000000 and 999999, which is the system-assigned job number.
Top

Spooled fie number (SPLNBR)

Specifies the unique number of the spooled file attached to the distribution message.

*ONLY
Only one spooled file in the job has the specified file name; therefore, the number of the spooled file is not necessary.
*LAST
If there is more than one spooled file with the specified file name, the one with the highest number is the file that is sent.
integer
Specify the number of the spooled file that matches the file you want to send.
Top

Page range to send (PAGERANGE)

Specifies the page range to send.

Element 1: Starting page

1
The first page of the spooled file.
starting-page
Specify the starting page to send.

Element 2: Ending page

*END
The last page of the file is the ending page to send.
ending-page
Specify the ending page to send.
Top

Page selection (SLTTXT)

Specifies the text contained within a page of the spooled file that you want to select to attach to the distribution message.

Note: To search the entire page for the selection text do not specify a line number or starting position.

Element 1: Selection text

*NONE
The entire spooled file will be sent.
character-value
Specify the text within a page of the spooled file that you want to attach to a distribution message. For example, you can specify SLTTXT('Account - 1234'), and Advanced Job Scheduler will select out the pages that contain 'Account - 1234' to send to the recipient you have specified.

Element 2: Line number

0-256
Specify the line number within the spooled file.

Element 3: Starting position

0-256
Specify the starting position within the spooled file.
Top

Attachment name (ATTACH)

Specifies the name to be used for the distribution message attachment.

*SPLF
The attachment file name is the name specified for the Spooled file (SPLF) parameter.
*NONE
No attachment file name is specified. The spooled file will be embedded into the body of the message.
name
Specify the name for the spooled file attachment.
Top

Attachment suffix (SUFFIX)

Specify the extension name for the spooled file attachment. You can specify any 3 or 4 character extension for your spooled file. The default extension is PDF for a portable document format attachment conversion. However, changing the extension does not necessarily change the actual format of the file itself. For example, if you were to change the extension to TXT, the attached file would only have the characteristics of a text file attachment when mailed, and not be an actual text file itself. This will only work if you have an actual text file on your system that you need to attach to an e-mail.

Note: Apart from PDF, TXT is the only extension that will convert correctly to an e-mail attachment.

PDF
The attachement is converted to a PDF (Portable Document Format) file.
character-value
Specify the file extension for the spooled file attachment.
Top

Remove spooled file (RMVSPLF)

Specifies if you want to remove the spooled file attachment from your system after the distribution message has completed.

*NO
You do not wish to remove the spooled file after the message has completed.
*YES
You do wish to remove the spooled file after the message is completed.
Top

Internet address (TOINTNET)

Specifies the internet address (i.e. e-mail address) for the distribution message.

*NONE
There is no internet address for this message.
character-value
Specify the internet address for the distribution message.
Top

Address location (ADRLOC)

Specifies the parameters that you want to use to find the address information (i.e. e-mail addresses) for the distribution message. This includes the line number within the spooled file, the starting position, the length, and the search text. An e-mail address can be extracted from each page of the spooled file or can be retrieved using an exit program and the value extracted from each page of the spooled file. For example, you can specify that the e-mail address for the invoice is always on line 3, position 45 for a length of 40. Or you can specify that the e-mail address is found after the word 'Email:' for a length of 40. Or you can specify that the account number for a customer is found after the word 'Account:' for a length of 10 and the exit program to retrieve the e-mail address for the account number extracted.

Element 1: Line number

*TEXT
You will use search text to identify the address information.
0-256
Specify the line number within the spooled file.

Element 2: Starting position

*AFTER
The starting position will be the first character after the located search text.
0-256
Specify the starting position within the spooled file.

Element 3: Length

0-60
Specify the length of the address information.

Element 4: Text

character-value
Specify the text to search for within the spooled file.
Top

Exit program (PGM)

Specifies the program that Advanced Job Scheduler will use to retrieve the address. The ADRLOC parameter will be used to located the key information that the program will need to find the address information. This user-written program must have 2 parameters. The first is a 60-byte character parameter. It will contain the value extracted from the spooled file based on the line number, starting position and length. The second is a 256-byte character parameter. It should return the e-mail address to use when sending that page of the spooled file. It should return blanks if no address is found.

Single values

*NONE
No program is used to retrieve the address.

Qualifier 1: Exit program

name
Specify the name of the exit program.

Qualifier 2: Library

*LIBL
The library list is used to locate the program.
*CURLIB
The current library is used to locate the program. If no current library is defined for the job, QGPL library is used.
name
Specify the name of the library where the exit program is located.
Top

Examples

SNDDSTJS   SPLF(QPINVOICE)  JOB(*)  SPLNBR(*LAST)
           MSG('Attached is your invoice.')
           PGM(MYLIB/PGMEXIT)  ADRLOC(5 3 10)

This command sends the most-recently created spooled file named QPINVOICE for the current job as an e-mail attachment. The exit program PGMEXIT in library MYLIB will be invoked. The account number is found on line 5 of each page of the spooled file, in position 3 and is 10 in length. The program is called to retrieve the e-mail address for the account number found in the spooled file.

Top

Error messages

Unknown
Top