Document toolboxDocument toolbox

System Variables


S2PX Translations

This page list the DataStage System Variables available for use in Server Jobs and their treatment by S2PX.

Variable Name

Description

S2PX Translation

Notes

Variable Name

Description

S2PX Translation

Notes

@DATE

The internal date when the program started. See the Date function.

DaysSinceFromDate2(StringToDate(DSJobStartDate), StringToDate('1967-12-31'))

@DAY

The day of the month extracted from the value in @DATE.

MonthDayFromDate(StringToDate(DSJobStartDate))

@FALSE

The compiler replaces the value with 0.

No translation. @FALSE is available in the Parallel Engine.

@FM

A field mark, Char(254).

Char(30)

@IM

An item mark, Char(255).

Char(31)

@INROWNUM

Input row counter. For use in constraints and derivations in Transformer stages.

@INROWNUM is available in the Parallel Engine and is used in all instances except when it is used inside a Transformer with no input links. In this case S2PX replaces @INROWNUM with @ITERATIONS to ensures the generated Parallel Job produces matching output.

@OUTROWNUM

Output row counter (per link). For use in derivations in Transformer stages.

No translation. @OUTROWNUM is is available in the Parallel Engine.

@LOGNAME

The user login name.

Unsupported

@MONTH

The current extracted from the value in @DATE.

MonthFromDate(StringToDate(DSJobStartDate))

@NULL

The null value.

setnull()

@NULL.STR

The internal representation of the null value, Char(128).

Char(25)

@PATH

The path name of the current InfoSphere DataStage project.

Unsupported

@SCHEMA

The schema name of the current InfoSphere DataStage project.

DSProjectName

@SM

A sub-value mark, Char(252).

Char(28)

@SYSTEM.RETURN.CODE

Status codes returned by system processes or commands.

Unsupported

@TIME

The internal time when the program started. See the Time function.

StringToTime(DSJobStartTime)

@TM

A text mark, Char(251).

Char(26)

@TRUE

The compiler replaces the value with 1.

No translation. @TRUE is available in the Parallel Engine.

@USERNO

The user number.

Unsupported

@VM

A value mark, Char(253).

Char(29)

@WHO

The name of the current InfoSphere DataStage project directory.

DSProjectName

@YEAR

The current year extracted from @DATE.

YearFromDate(StringToDate(DSJobStartDate))

System Marks

Universe has a set of ‘System Mark’ characters which are used to support multi-valued strings. These characters are represented as fixed ASCII values, have special handling when converting to and from NLS Code pages and Unicode, and can be accessed directly using system variables. The table below shows the ASCII and Unicode Hex Values for each System Mark:

System Variable

Description

ASCII Character

Unicode Character

System Variable

Description

ASCII Character

Unicode Character

@IM

Item Mark

0xFF

0xF8FF

@FM

Field Mark

0xFE

0xF8FE

@VM

Value Mark

0xFD

0xF8FD

@SM

Sub-value Mark

0xFC

0xF8FC

@TM

Text Mark

0xFB

0xF8FB

@NULL.STR

Null String

0x80

0xF8F7

One of the first things to note is that the ASCII Character values are outside the standard 0x00-0x7F range and don't usually map to a valid character when using single byte NLS mappings. This is by design as all these values have special functionality within Universe and Server Job Transformers. The exception to this is @NULL.STR which typically maps to the Euro Symbol , however the euro symbol (0x80) was introduced long after these values were introduced to Universe.

Due to the way multi-byte character encodings such as UTF-8 write characters outside the 0x00-0x7F range, none of the ASCII character values can be used directly. Instead they are translated to Unicode code points in one of the higher plane ranges.

As a direct consequence of the ASCII and Unicode character values used by Universe, there is no way to support these characters in Parallel without potentially causing NLS encoding issues. Evidence indicates that the vast majority of DataStage users only use these mark fields as superficial delimiters, therefore S2PX uses a different encoding for these variables that are within the simple 0x00-0x7F ASCII range, avoiding potential NLS issues:

System Variable

ASCII Character (Hex)

ASCII Character (Dec)

ASCII Character Name

System Variable

ASCII Character (Hex)

ASCII Character (Dec)

ASCII Character Name

@IM

0x1F

31

Unit Separator

@FM

0x1E

30

Record Separator

@VM

0x1D

29

Group Separator

@SM

0x1C

28

File Separator

@TM

0x1A

26

Substitute

@NULL.STR

0x19

25

End of Medium

The mappings for the Extract and Substrings Transformer functions account for the S2PX-specific encodings of these marks.


See also

 

© 2015-2024 Data Migrators Pty Ltd.