Skip to main content
Skip table of contents

RPLSTRIFS, replace character string in input file

Usage

The RPLSTRIFS command can be used to replace a string in the input file with another value.

Parameters and their meaning

The command has the following parameters

Parameter

Element

Value

Description

FRMPATH

Name of the input path in the IFS file system. If the command is defined in the i-effect *SERVER *IFS server entry as a *USERDEFINED
processing step, the %IFSPATH% server variable can be used.

FRMIFSFILE

Name of the input file in the IFS file system without path. If the command is defined in the i-effect *SERVER *IFS server entry as *USERDEFINED
processing step, the %IFSFILE% server variable can be used.

FRMCCSID

The CCSID of the input file. The default is 1252.

CASE

*YES

Uppercase and lowercase letters are distinguished

*NO

Uppercase and lowercase letters are not distinguished

REPLACE

Here you can specify which search patterns are replaced with which values in the input file. Up to 50 replacement rules can be defined here.

Element 1

This element defines a search pattern that is searched for.

HEXSuchmuster

By specifying the character string HEX before the actual search pattern, the character string to be searched for can be specified in hexadecimal notation.

To replace a ';' character at the end of a line (hexadecimal value x'540d25') with a line feed (hexadecimal x'0d25'), the following parameter definition can be used:

CODE
REPLACE((HEX5E0D25 HEX0D25))

To remove a line feed, the following parameter definition can be used:

CODE
Beispiel: REPLACE((HEX0D25))

Element 2

This element defines the replacement string with which each string value found in element 1 is replaced.

HEXZeichenkette

By specifying the character string HEX before the actual replacement string, the replacement can be specified in hexadecimal form.

CODE
REPLACE((HEX5E0D25 HEX0D25))

*CRLF

The string found is replaced with a line feed (CRLF).

CODE
REPLACE((HEX5E0D25 *CRLF))

*ADDCRLF

A line feed (CRLF) is added to the found string.

CODE
REPLACE((HEX5E0D25 *ADDCRLF))

USESEPCHAR

This parameter is no longer used and will be removed in a future version.

USEBUFFER

This parameter is no longer used and will be removed in a future version.

Examples of use

Description

Command parameter definitions

EReplaced the string ENACOM with the string UN in the input file.

CODE
RPLSTRIFS FRMPATH('/home/ieffect/as/receive') FRMIFSFILE(orders.edi) REPLACE((EANCOM UN))

Replacing the EBCDIC character (x'5E') with the EBCDIC characters for line feed (x'5E0D25')

CODE
RPLSTRIFS ... REPLACE((HEX5E0D25 HEX0D25))               

Removing a line feed character (x'0D25') from a file

CODE
RPLSTRIFS ... REPLACE((HEX0D25))                            
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.