Please enable JavaScript to view this site.

This program takes parameters one to five and merges them into one parameter returned in PARM1. Parameter six determines how the merging of each parameter will be handled.

The parameters are as follows:

Parameter

Description

Comments

PARM1

Data String

The first data string that you wish to merge

PARM2

Data String

The second data string that you wish to merge

PARM3

Data String

The third data string that you wish to merge

PARM4

Data String

The fourth data string that you wish to merge

PARM5

Data String

The fifth data string that you wish to merge

PARM6

Special format

A formatted string of characters to determine how to merge the above 1-5 parameters see table below

How to format PARM6

If all you wish to do is concatenate strings of data trimming the leading and trailing spaces and not having any space between the parameters then you do not need to specify anything in PARM6 as this is the default.

Each parameter, however, may have the following rules applied to it when merging:

Retain leading spaces – Retain spaces

Remove leading zeros – Trim zeros

Fill leading spaces with zeros – Fill zeros

Add a single space before merging with next parameter – Space after

These following four rules may be specified for each parameter.

Input

Values

Retain spaces

Y = Yes

Trim zeros

Y = Yes

Fill zeros #1

Y = Yes

Space after

Y = Yes

Length of String #2

nn – where nn is a number e.g. 01, 12 (both characters must be used i.e. "01" not "1".

The values must be specified in the correct order with a comma (,) between the rules for each individual parameter. Please refer to the following examples for a better explanation of the formatting for PARM6.

Notes:

#1If you are using the rule Fill Zeros then it will be assumed that you wish to also Retain spaces and you will not need to enter the “Y” for the first rule.
#2If left blank this will default to the length of the data string passed in the parameter. If you wish to specify a length then you must supply two digits i.e. for a string of length four you must specify ‘04

Example 1 - Formatting an email address

Parameter

Input

Output

PARM1

Joe

Joe_Bloggs@cobwebb.co.uk

PARM2

_


PARM3

Bloggs


PARM4

@cobwebb.co.uk


PARM5



PARM6



There is no requirement here for anything to be passed in PARM6 as each field wants to be merged without any spaces.

Example 2 - Formatting a numeric with a pound sign

Parameter

Input

Output

PARM1

£

£126.50

PARM2

   126.50


PARM3



PARM4



PARM5



PARM6



There is no requirement here for anything to be passed in PARM6 as each field wants to be merged without any spaces.

Example 3 - Formatting a numeric with pound sign and CR with spaces between

Parameter

Input

Output

PARM1

£

£ 126.50 CR

PARM2

000126.50


PARM3

CR


PARM4



PARM5



PARM6

  y, y y


PARM 6 formatting explained

PARM1 -We want to add a space after this parameter. Because we wish to add a space after we must also put three spaces before the y as otherwise the y would represent the “Retain spaces”
PARM2 - We want to remove leading zeros if they are there. Here we have a space followed by a y for the second rule and then a space followed by a y.

Example 4 - This is an all singing and dancing example.

Parameter

Input

Output

PARM1

£

£126.50CR 000012345 xyz

PARM2

  126.50


PARM3

CR


PARM4

   12345


PARM5

xyz


PARM6

, y,   y,  yy


PARM 6 formatting explained

PARM1 -No formatting required so we just have a comma.
PARM2 - We want to remove leading zeros if they are there. Here we have a y for the second rule and then a comma as the remaining rules are defaulted.
PARM3 -We want to add a space after this parameter. Because we wish to add a space after we must also put three spaces before the y as otherwise the y would represent the “Retain spaces”
PARM4 -We want to add leading zeros and add a space after. We need to add two spaces before the two "y"s otherwise this would mean Retain spaces and Trim zeros.

Note: If you are using the rule “Fill Zeros” then it will be assumed that you wish to “Retain spaces”.

Example 5 - This example shows the use of defined string lengths

Parameter

Input

Output

PARM1

ID

ID        Description              Value

PARM2

Description


PARM3

Value


PARM4



PARM5



PARM6

   10,    30


PARM 6 formatting explained

PARM1 -We want this to take up a length of 10 characters so we have used 10 for the fifth rule.
PARM2 - We want this to take up a length of 30 characters so we have used 30 for the fifth rule.
PARM3 -No formatting required.

Note: If you are using the rule “Length of String” then these must be specified as two characters e.g. "01" for "1" etc.