SPECifications

Filter:

SPECS

Syntax:

SPECS [STOP] [ALLEOF | ANYEOF] Input Conversion Output Alignment

Operands:

Input :: SELECT streamnum
:: Words wordnumber_range
:: Fields fieldnumber_range
:: columnnumber_range
:: Xhexstring
:: Hhexstring
:: Binarystring
:: RECNO [FROM from_num] [BY by_num]
wordnumber_range :: start_wordnumber '-' end_wordnumber
fieldnumber_range :: start_wordnumber '-' end_wordnumber
columnnumber_range :: start_column '-' end_column (DEFAULT 1-*)
:: start_column '.' number_of_columns
streamnum :: input stream number, 0 for primary or 1 for secondary

Conversion :: C2B Character to Binary
:: C2D Character to Decimal
:: C2X Character to Hex
:: X2C Hex to Character
:: X2B Hex to Binary
:: X2D Hex to Decimal
:: D2C Decimal to Character
:: D2B Decimal to Binary
:: E2A EBCDIC to ASCII
:: A2E ASCII to EBCDIC

Output :: Next [.n]
:: NEXTWord [.n]
:: NWord
:: column_range

Alignment :: Left
:: Center
:: Right

string :: delimiter character_string delimiter
hexstring :: X||*hex_code | H||*hex_code
hex_code :: any valid hexadecimal code string
binarystring :: B||*binary_digits
binary_digits :: 0 | 1
delimiter :: any character not used in the locate string
start_column :: integer | 1
end_column :: integer | *

Functional Description:

Use the SPECS stage to rearrange the contents of records presented in an input stream.

SPECS constructs one or more output records on a field-by-field basis. The output fields can come from input record fields (from one or more input records), literal values, the record number, or the time-of-day clock.
The data may be converted into a different format before it is placed in the output record.
The output data can be left-aligned, centered, or right-aligned in the output field.

The basic format of the SPECS stage is:

__SPECS____ input ____ [conversion] _______ output ____ [alignment] _______

input is literal data or the location of data in the input record you specify. For example, you can specify the string ABC or columns 1 through 5 of the input record.

conversion is the type of conversion you can specify to change the format of the input data. For example, input records in binary integer format can be converted to a printable decimal string.

output is the location where the data will be placed. For example, the data can begin in column 3 of the output record.

alignment is the type of alignment you can specify for the data written to the primary output stream. You can specify the output data to be left-aligned, centered, or right-aligned.

Hhexstring and Xhexstring:
defines a string of hexadecimal characters, following the X or H. The X or H can be specified in uppercase or lowercase. You must not specify any spaces in the string. There must be an even number of hexadecimal characters in the string.

Binarystring:
defines a string of binary (1 and 0) characters, following the B. The B can be specified in uppercase or lowercase. You must not specify any spaces in the string. There may be any number of binary digits in the string.

Negative location on column range is not supported.

Secondary Input/Output:

None yet

Synonyms:

None

Usage Notes:

The following example will take the literal "The rain" and place in starting in col 4, then place "in Spain" starting at the next word, then translate "falls mainly" from character to hex and place that string at the next word location. output.

literal The rain | SPECS 1-* 4 /in Spain/ NEXTW /falls mainly/ C2X NEXTW | CONSOLE

The following example will take the literal "The rain" and place in starting in col 4, then place "in Spain" starting at the next word, then "falls mainly" at the next word, then translate the binary string to an exclamation mark and append it onto "mainly".

literal The rain | SPECS 1-* 4 /in Spain/ nextw /falls mainly/ NEXTW B00100001 Next | CONSOLE

The following example will take the literal "The rain in Spain", then fans it to 2 streams, the primary stream is sent to SPECS, the secondary stream is first sent to CHANGE to alter the word Spain to England, then redirected to SPECS secondary input; SPECS then writes out both strings one after the other.

literal The rain in Spain | a: fanout | b: SPECS 1-* SELECT 1 1-* NEXTW | CONSOLE ? a: | change 1-* /Spain/England/ | b:


JAVA Pipelines

Cullen Programming logo