Problems with mainframe emulator using EHLLAPI
Hi there,
I am using EHLLAPI to connect to a mainframe emulator. I can connect to the session and do some major commands (e.g. connect, disconnect, get cursor, set cursor, sendkey, copy ps to string, etc.). The emulator is Rumba version 5.2. What I can't get my Windows app to do is to chain a bunch of commands together. For example: I want to loop where I use Sendkey, then SetCursor, the Sendkey, SetCursor, Copy PS to String, etc.). I can't get the chain of commands to work, only the first two or so work and then nothing. Thanks in advance.
Answers (9)
0
Do not execute this query directly first understand all statements and thing about your requirement... here is basic queries, let me know next queries later after understanding this...
-
- Select ProductID, ProductName, ClosingStockQTy, ClosingStockRs from ProductMaster where Product = 1
-
-
- insert into Purchases (BillNo, BillDate, ProductID, Rate, Discount, Qty, TotalAmount)
- values
- (
- 'CP1',
- getdate(),
- @ProductID,
- @Rate,
- @Discount,
- @Qty,
- @TotalAmount
- )
-
- declare @StockQTy as int=0;
- set @StockQTy = (select top 1 ClosingStockQty from ProductMaster where ProductID = 1);
- set @StockQTy = @StockQTy + @Qty;
-
- Update ProductMaster
- set
- ClosingStockQTy = @StockQTy
- Where
- ProductID = 1
-
-
-
- insert into Sales (BillNo, BillDate, ProductID, Rate, Discount, Qty, TotalAmount)
- values
- (
- 'CS1',
- getdate(),
- @ProductID,
- @Rate,
- @Discount,
- @Qty,
- @TotalAmount
- )
-
- declare @StockQTy as int=0;
- set @StockQTy = (select top 1 ClosingStockQty from ProductMaster where ProductID = 1);
- set @StockQTy = @StockQTy - @Qty;
-
- Update ProductMaster
- set
- ClosingStockQTy = @StockQTy
- Where
- ProductID = 1

0
You can use inner join and left join to get the result.
- select PM.ProductID, PM.ProductName, PM.MRP,
- Purchase.BillDate as PurchaseBillDate,Purchase.Rate as PurchaseRate,
- Sales.BillDate as SalesBillDate,Sales.Rate as SalesRate
- from Productmaster PM
- inner join Purchase on PM.ProductID=Purchase.ProductID
- left join Sales on PM.ProductID = Sales.ProductID
- where PM.ProductID= 1000