XPROCESS Utility

The XPROCESS utility is an external data processor used when sending or receiving data. You typically use the XPROCESS utility to prepare data for transmission to a Trading Partner or to prepare data that you received from a Trading Partner. You invoke the XPROCESS utility in the command line of a Delivery Rule.

About the XPROCESS Utility

The syntax of the XPROCESS utility is:

XPROCESS [option] [Parameter1] [Parameter2] [Parameter3]

As an example:

The VAN that your Trading Partner uses expects each line of data to be terminated with a Carriage Return and Line Feed. Your data is terminated by tilde (~) characters. You use the XPROCESS utility to convert the tildes into Carriage Return/Line Feed characters.

Note: If you are a new Sterling Gentran:Server® customer, we suggest you use the Xprocess DLL Agent to perform similar functions.

XPROCESS Parameters

Note: When using a <filename> parameter, you must specify a full path and filename unless this utility is being invoked by means of the EXE Delivery Agent. In that case, only the $Filename token is necessary to represent the filename.
Table 1. Parameter options and descriptions
Option Description
-0 Converts any specified hexadecimal character [hexValue1] to another hexadecimal character [hexValue2].
xprocess -0 <hexValue1> <hexValue2> <filename>
-1 Appends the file you specify [filename] to the beginning of the data. This option is often used as a preprocessor when sending data to the AT&T GMS network.
xprocess -1 <inputfile1> <inputfile2> <outputfile>
-2 Replaces the tilde, Carriage Return, and Line Feed characters with a single Carriage Return. This option is often used as a preprocessor when sending data to the GEIS network.
xprocess -2 <filename>
-3 Replaces all Carriage Returns with tildes and removes all Line Feeds. This option is often used as a preprocessor when receiving data from the GEIS network.
xprocess -3 <filename>
-4 Removes all Carriage Returns and Line Feeds.
xprocess -4 <filename>
-5 Removes all Carriage Returns and Line Feeds and adds one hexadecimal character (0x1A) at the end of the file. This option is often used as a preprocessor for the TDSI network.
xprocess -5 <filename>
-6 Removes all hexadecimal 0x1A characters. This option is often used as a prepostprocessor for the TDSI network.
xprocess -6 <filename>
-7 Adds GM header and trailer records and removes all Carriage Returns and Line Feeds. This option is often used as a preprocessor for GM. It creates a THS and THD segment for the header and a TTR for the trailer.
xprocess -7 <youruserid> <theiruserid> 
<fileonGMsystem>
-8 Replaces all tilde, Carriage Returns, and Line Feed characters with a single Carriage Return. This option is often used as a preprocessor when sending data to the MCI network.
xprocess -8 <filename>
-9 Replaces all Line Feed characters with a tilde. This option is often used as a preprocessor when receiving data from the MCI network.
xprocess -9 <filename>
-10 Replaces all Carriage Returns with Carriage Return/Line Feeds. This option is often used when receiving files from Commerce:Network.
xprocess -10 <filename>
-11 Replaces a string of hexadecimal characters with a second string of hexadecimal characters.
xprocess –11 <hexString1> <hexString2> <filename>
Note: Each hexadecimal string value contains the prefix 0x, followed by a 2-digit hexadecimal value. Together, the prefix and the 2-digit hexadecimal value are considered one hexadecimal character.

Example 1

The following is an example of a command line using option -11. When executed, this command converts each ~CRLF to ~ (tilde)

c:\gensrvnt\bin\xprocess.exe -11 0x7e0x0d0x0a 0x7e inputfile.txt

In this example, the first string contains three hexadecimal characters(0x7e,0x0d, and 0x0a) and the second string contains one hexadecimal character (0x7e). Inputfile.txt designates the file name of the input.

Example 2

The following is an example of a command line when executed using the EXE Delivery Agent. When executed, this command converts each ~CRLF to ~ (tilde)

/o $Input c:\gensrvnt\bin\xprocess.exe -11 0x7e0x0d0x0a 0x7e $Input

In this example, the first string contains three (3) hexadecimal characters(0x7e,0x0d, and 0x0a) and the second string contains one (1) hexadecimal character (0x7e). The $Input token designates the file name of the input.

-12 Removes all occurrences of a hexadecimal string from a file.
xprocess –12 <hex string> <filename>
-13 Inserts a hexadecimal string at the prescribed increment (Nbr Bytes) in the input file. This option is typically used (but not limited to) blocking streamed EDI data.
xprocess -13 <NbrBytes> <HexStringToInsert> <InputFile>

Additional Parameters

The following table describes additional XPROCESS Utility parameters.

Table 2. Additional parameters and descriptions
Parameter Description
hexValue1 A hexadecimal value in the format 0x??. Used with the -0 option (described in the table above) and is the character you want to replace in the data.

where: ?? is the hexadecimal value.

hexValue2 A hexadecimal value in the format 0x??. Used with the -0 option (described in the table above) and is the new character you are exchanging for hexValue1.

where: ?? is the hexadecimal value.

hexString1 A hexadecimal string in the format 0x??0x??. Used with option -11 (described in the table above).

where: ?? is the hexadecimal value.

Note: Each hexadecimal value contains the prefix 0x, followed by a 2-digit hexadecimal value. Together, the prefix and the 2-digit hexadecimal value are considered 1 hexadecimal character.

Example

0x7e0x0d0x0a

This example describes a hexadecimal string containing three hexadecimal characters.

hexString2 A hexadecimal string in the format 0x??0x??. Used with option -11 (described in the table above).

where: ?? is the hexadecimal value.

Note: Each hexadecimal value contains the prefix 0x, followed by a 2-digit hexadecimal value. Together, the prefix and the 2-digit hexadecimal value are considered one hexadecimal character.

Example

0x7e0x0d0x0a

This example describes a hexadecimal string containing three hexadecimal characters.

filename The name of the file on which you want to run XPROCESS. Used only when you run XPROCESS from the command line. If you are using XPROCESS in a Delivery Rule, you do not need to include a filename. The filename is passed automatically by Mailbox Server.
NbrBytes Specifies a predefined increment at which you want to insert a hexadecimal string value. Used with the -13 option (described in the table above).
HexString ToInsert Specifies a hexadecimal string value that you want to insert at a pre-defined increment. Used with the -13 option (described in the table above).

Example 1

In this example, a Trading Partner has sent a file that uses Null characters to terminate segments. Sterling Gentran:Server expects to see a tilde (~) character as the segment terminator.

Original Data

ISA*00*          *00*          *08*9275310000     *12*5088947000334  
*970812*1133*U*00304*000000132*0*P*><null>GS*GP*001677954*5088947000334*9 
70812*1133*83*T*003040UCS<null>ST*880*000830001<null>

Delivery Rule command line

Use the following command line to replace the Null character (hexadecimal value 0x00) with a tilde character (hexadecimal value 0x7E):

/o $Input XPROCESS.EXE -0 0x00 0x7E $Input

Modified Data

ISA*00*          *00*          *08*9275310000     *12*5088947000334  
*970812*1133*U*00304*000000132*0*P*>~GS*GP*001677954*5088947000334*9
70812*1133*83*T*003040UCS~ST*880*000830001~

Example 2

In this example, a Trading Partner has sent a file that uses a forward slash (/) to separate elements. Sterling Gentran:Server expects to see an asterisk (*) character as the element separator.

Original Data

ISA/00/          /00/          /08/9275310000     /12/5088947000334  /970812/
1133/U/00304/000000132/0/P/>~GS/GP/001677954/5088947000334/9
70812/1133/83/T/003040UCS~ST/880/000830001~

Delivery Rule command line

Use the following command line to replace the forward slash character (hexadecimal value 0x5C) with an asterisk character (hexadecimal value 0x2A):

/o $Input XPROCESS.EXE -0 0x5C 0x2A $Input

Modified Data

ISA*00*          *00*          *08*9275310000     *12*5088947000334  
*970812*1133*U*00304*000000132*0*P*>~GS*GP*001677954*5088947000334*9
70812*1133*83*T*003040UCS~ST*880*000830001~