Last post Jul 29, 2016 10:02 PM by Lannie
Jul 29, 2016 01:26 PM|Sandhya Gidda|LINK
I have a question in regards to the character alignment when we are retrieving data from AS400.
We want the alignment in the Characters to be spaced in a similar fashion across the string variable but we are finding that we cannot control this and the text is out of alignment.
We have a notes screen on the AS400 that was created in DDS (10 lines and 70 chars across) and when one of our users enter notes on the screen they are aligned, however, when we read data into .Net using DB2Connection we find the characters are not aligned
Is there anyway we can control this behavior through DB2connection?
Are there any options we can use? or can we control this programmatically in the .net / C# code or when we use SQL to cast the data into our program?
We have looked online and cannot see anything obvious to us?
I am not able to successfully attach the example screen shots to explain the scenario.
Jul 29, 2016 02:42 PM|march11|LINK
Not sure what you are trying to do format wise in .NET, but you should be able to fully control placement in the .NET environment. What language are you using? Have you tried TRIM statements to remove spacing? In .NET you can use the string format functions
to do just about anything you need to.
Post your .net code.
I have found that the data type in databases can cause unusual behavior when strings are assigned in .net, for example nchar and varchar data types format unusually sometimes in .Net. I have had to use nvarchar data types in SQL to get better behavior, I
think this may have to do with the support of UNICODE characters.
Jul 29, 2016 10:02 PM|Lannie|LINK
The other issue is BINARY GARBAGE, that is, non-printable characters (TAB, and many others). If your data collection application does not clean these up front on processing, they get loaded into the database, then when extracted, the strings are affected
with unexplained formatting.