Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gentran Mapping - LEFT Function

Status
Not open for further replies.

wiseeider

Technical User
Aug 12, 2002
1
US
We are in the process of taking over an existing Gentran 3.0 NT installation and are trying to understand the mappings that already exist.

When dealing with a negative numeric with the negative sign to the right of the numerics.

The mapping script uses the LEFT functions as follows:
[begin
char_size = minus_sign - 1;
#BETRG:2 = left(#BETRG:2,char_size); << if minus_sign is less than or equal to zero, then char size must be negative??
end ] Can anyone explain what the LEFT function is actually doing?. We assume its moving the cursor back one step and then taking the numerics to its left and moving those to the destination.

Thanks

Wiseeider


 
wiseeider:

The LEFT function takes the specified number of characters from the left of the string. If char_size = 2, then it is the first two chars of the string. I don't see any logic that initializes minus_sign, but I'm assuming that it is the total length of the field including the negative sign. If the data is 123456-, then I think the intention is to make char_size = 6. Then the result of the left function will return the first 6 characters (123456).

I'm guessing there's a &quot;minus_sign = len(BETRG:2)&quot; statement somewhere in there (or used to be).

Good luck,
K.Hood
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top