Originally posted by: rarw
Hi,
I am processing a cobol flat file and need to selectively pick out some of the data. I am using the LEFT function to do this, but it is not working when the ETHNICITY field is composed of spaces instead of alpha data. There are other fields, the race codes, in the record that are filled with spaces and there does not seem to be a problem with these.
The incorrect output that is produced has an extra blank character, this can be seen below in the example output. For visibility, in the description below, I have replaced blank characters (spaces) with periods.
This seems like an easy operation to apply and why it is adding an extra blank char, or not taking a blank char out of the output, is a mystery to me.
In the description below the field name is followed by the size of the field. All fields are text and padded with spaces.
Thank you for your time and help!
Becky
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example Input:
PRIMARY_LANGUAGE_3 = EN. record 1, = EN. record 2
ETHNICITY_2 = .. record 1, = NH record 2
RACE1_2 = WH record 1, = AA record 2
RACE2_2 = .. record 1, = .. record 2
RACE3_2 = .. record 1, = .. record 2
RACE4_2 = .. record 1, = .. record 2
RACE5_2 = .. record 1, = .. record 2
Records:
record 1: EN...WH........
record 2: EN.NHAA........
Total record length = 15
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example Output:
PRIMARY_LANGUAGE_3
ETHNICITY_1 LEFT(ETHNICITY_2,1)
RACE1_1 LEFT(RACE1_2,1)
RACE2_1 LEFT(RACE2_2,1)
RACE3_1 LEFT(RACE3_2,1)
RACE4_1 LEFT(RACE4_2,1)
RACE5_1 LEFT(RACE5_2,1)
Records:
Record 1: EN...W.... (incorrect output) Want: EN..W....
Record 2: EN.NA.... (correct output)
Expected total record length = 9
#DataExchange#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender