How to make SendKeys act Synchronously in IBM Host Access Library

The “Operator Information Area” class seems to provide a solution for this problem. My general case seems to be working correctly with this implementation: Friend Sub PutTextWithEnter(ByVal field As FieldDefinition, ByVal value As String) If IsNothing(field) Then Throw New ArgumentNullException(“field”) If IsNothing(value) Then Throw New ArgumentNullException(“value”) _Presentation.SendKeys(Mid(value.Trim, 1, field.Length).PadRight(field.Length) & “[enter]”, field.Row, field.Column) WaitForEmulator(_Session.Handle) End … Read more

Equivalent of LIMIT for DB2

Using FETCH FIRST [n] ROWS ONLY: http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.perf/db2z_fetchfirstnrows.htm SELECT LASTNAME, FIRSTNAME, EMPNO, SALARY FROM EMP ORDER BY SALARY DESC FETCH FIRST 20 ROWS ONLY; To get ranges, you’d have to use ROW_NUMBER() (since v5r4) and use that within the WHERE clause: (stolen from here: http://www.justskins.com/forums/db2-select-how-to-123209.html) SELECT code, name, address FROM ( SELECT row_number() OVER ( ORDER … Read more

Convert String from ASCII to EBCDIC in Java?

Please note that a String in Java holds text in Java’s native encoding. When holding an ASCII or EBCDIC “string” in memory, prior to encoding as a String, you’ll have it in a byte[]. ASCII -> Java: new String(bytes, “ASCII”) EBCDIC -> Java: new String(bytes, “Cp1047”) Java -> ASCII: string.getBytes(“ASCII”) Java -> EBCDIC: string.getBytes(“Cp1047”)