I am trying to write an expression where it would give the below output in Abinitio GDE

304 Views Asked by At

input in zero byte file made in unix:

2000560|Bibek|28

3490679|kjdsk|56

1775679|Samrat|45

my output needed is

Bi

kj

Sa

2

There are 2 best solutions below

0
On

record string("|") col1; string("|") col2 string("\n") col3; end;

out::transform(in) = begin out.value::string_substring(in.col2, 1,2); end;

1
On

read file then use reformat. Below is the transformation out::reformat(in)= begin out.out_field:: string_substring(in.field2,0,2); end;

index starts from 0