ibm-midrange

Concatenate Multiple Row Values into 1 Row, with SQL for iSeries

廉价感情. 提交于 2019-12-01 08:57:14
问题 First, I need to thank Kent Milligan and his article at http://www.mcpressonline.com/sql/techtip-combining-multiple-row-values-into-a-single-row-with-sql-in-db2-for-i.html for getting me as far in this problem as I have. But now I need to expand on what he has done here. To avoid you having to go to his article, the problem he addressed was concatenating string data from multiple rows into a single row in the resulting table. For example: Table Cars: Make Model Ford Fusion Chevy Tahoe Honda

How to view Journal data of a Table Green screen DB2

会有一股神秘感。 提交于 2019-12-01 08:01:13
How do you view journal data from a specified table? I want to see what happended to a table in a specified time frame. I got info on the table by using the following command: DSPFD FILE(P6PRDBDB00/P6OIDPF) Got the journaled name and library but I dont know how to view it for the object P6OIDPF? I did go to library #MXJRN and whent to P6 and got the following : How can I view the object P6OIDPF data? Or a command to view it? Theres a lot of objects in P6. The command to use is DSPJRN JRN(#MXJRN/P6) FILE((P6PRDBDB00/P6OIDPF)) You can Filter on start and end date time. The EXPJRNE utility from

DB2 for IBM iSeries: IF EXISTS statement syntax

亡梦爱人 提交于 2019-12-01 07:22:15
问题 I am familiar with Sybase which allows queries with format: IF EXISTS () THEN ... ELSE ... END IF (or very close). This a powerful statement that allows: "if exists, then update, else insert". I am writing queries for DB2 on IBM iSeries box. I have seen the CASE keyword, but I cannot make it work. I always receive the error: "Keyword CASE not expected." Sample: IF EXISTS ( SELECT * FROM MYTABLE WHERE KEY = xxx ) THEN UPDATE MYTABLE SET VALUE = zzz WHERE KEY = xxx ELSE INSERT INTO MYTABLE (KEY

Capturing onkeydown in Javascript

可紊 提交于 2019-12-01 00:29:49
I have a web front-end to an AS/400 CGI application which allows the use of some of the F1 - F24 keys (depending on the page) as well as page-up, page-down etc - these are passed to the underlying application which handles them appropriately. For instance, on a given page, a user could either press the F3 button or press the F3 key - both of them will set the (hidden) CmdKey variable to have a name of '_K03' and a value of 'F03'. The button handling is simple and has no problems. To handle users pressing an actual F-key on the keyboard, I have had an IE-compatible script for a long time which

Java: Convert String to packed decimal

淺唱寂寞╮ 提交于 2019-11-30 14:48:22
new here! Situation: I'm working on a project which needs to communicate with an AS/400 server. My task is to basically handle the requests which will be sent to the AS/400 server. To do this, all the user input should be in EDCDIC bytes. Problem: I have managed to convert packed decimals to String with the code below, found on this forum : public class PackedDecimal { public static long parse(byte[] pdIn) throws Exception { // Convert packed decimal to long final int PlusSign = 0x0C; // Plus sign final int MinusSign = 0x0D; // Minus final int NoSign = 0x0F; // Unsigned final int DropHO = 0xFF

SQL query of multi-member file on AS400

独自空忆成欢 提交于 2019-11-30 03:15:25
On AS400 in interactive SQL in a 5250 session, select * from myfile returns rows from one member only when myfile has more than one member. How can I get rows from a specific member? Important: in the end I'd like to do this over JDBC with jt400 so really I want a solution that'll work there. Thanks. You can create an alias using the create alias command: CREATE ALIAS myLibrary/myAlias FOR memberLibrary/memberFile(memberName) This will allow you to run sql against that member using the alias like you would any other file: SELECT * FROM myLibrary/myAlias Just remember that the alias will stick

Java: Convert String to packed decimal

谁都会走 提交于 2019-11-29 21:11:59
问题 new here! Situation: I'm working on a project which needs to communicate with an AS/400 server. My task is to basically handle the requests which will be sent to the AS/400 server. To do this, all the user input should be in EDCDIC bytes. Problem: I have managed to convert packed decimals to String with the code below, found on this forum: public class PackedDecimal { public static long parse(byte[] pdIn) throws Exception { // Convert packed decimal to long final int PlusSign = 0x0C; // Plus

Connect to AS400 using .NET

China☆狼群 提交于 2019-11-29 20:26:56
I am trying to build a .NET web application using SQL to query AS400 database. This is my first time encountering the AS400. What do I have to install on my machine (or the AS400 server) in order to connect? (IBM iSeries Access for Windows ??) What are the components of the connection string? Where can I find sample codes on building the Data Access Layer using SQL commands? Thanks. dcp You need the AS400 .Net data provider. Check here: https://www-01.ibm.com/support/docview.wss?uid=isg3T1027163 For connection string samples, check here: https://www.connectionstrings.com/as-400/ Also, check

AS400 SQL query with Parameter

风格不统一 提交于 2019-11-29 15:53:00
I am testing a simple query to get data from an AS400 database. I am not sure if the way I am using the SQL query is correct. I get an error: "The parameter is incorrect." Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = @Field1 I don't get an error when I run the following query: Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = 'myvalue' I am using ADODB, VBScript to test. Set Param1 = cmd.CreateParameter("@Field1", 129, 1, 9, "myvalue") ' 129 String cmd.Parameters.Append Param1 I am coming from MS Sql environment, so writing for AS400 is totally new for me. Thanks

C#: Convert COMP-3 Packed Decimal to Human-Readable Value

给你一囗甜甜゛ 提交于 2019-11-29 14:50:23
问题 I have a series of ASCII flat files coming in from a mainframe to be processed by a C# application. A new feed has been introduced with a Packed Decimal (COMP-3) field, which needs to be converted to a numerical value. The files are being transferred via FTP, using ASCII transfer mode. I am concerned that the binary field may contain what will be interpreted as very-low ASCII codes or control characters instead of a value - Or worse, may be lost in the FTP process. What's more, the fields are