GET-LIST then LIST not by @ID column
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
Is it possible in jBASE to get values from GET-LIST and then LIST not by @ID.
For example in isolated cases I use to LIST by using WITH:
LIST FBNK.STMT.ENTRY WITH REPAYMENT.TYPE='IN' AND (TRANS.REFERENCE='LD1536567891' OR TRANS.REFERENCE='LD1536567892') ACCOUNT.NUMBER TRANSACTION.CODE VALUE.DATE
But purpose is to extract info about 2000+ LD numbers. Is it possible to use GET-LIST with TRANS.REFERENCE column? If yes - how?
R10 on CentOS
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- retired
- Posts: 2859
- Thank you received: 649
SQLSELECT ACCOUNT_NUMBER, TRANSACTION_CODE, VALUE_DATE FROM 'FBNK.STMT.ENTRY' WHERE REPAYMENT_TYPE='IN' AND TRANS_REFERENCE IN (SELECT F0 FROM 'FBNK.LD.LOANS.AND.DEPOSITS' WHERE CATEGORY = "21000")
Please Log in or Create an account to join the conversation.
- VK
- Offline
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1181
- Thank you received: 157
SQL rules :)) While I was thinking of a possible solution with a subroutine that gets the list and returns it @VM-delimited so I could propose to use it in MATCHES EVAL "rtn_name(list_name)"...
Out of curiosity tried your statement... It worked with one small change - it didn't recognize F0, so see what's worked:
.. TRANS_REFERENCE IN (SELECT CONTRACT_NO_ FROM 'FBNK.LD.LOANS.AND.DEPOSITS' WHERE CATEGORY = "21062")
Cheers
VK
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- retired
- Posts: 2859
- Thank you received: 649
Was too lazy to look up the alternate name of @ID in LD ;-)
Please Log in or Create an account to join the conversation.
- VK
- Offline
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1181
- Thank you received: 157
Cheers
VK
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
R10 on CentOS
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- retired
- Posts: 2859
- Thank you received: 649
If you select them fom LD.LOANS.AND.DEPOSITS with any criteria you can use the same within sub-query.
If you just have a listing with 2000 LDs that have nothing in common we may ask VK to process further on his idea to use MATCHES EVAL "rtn_name(list_name)"...
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
R10 on CentOS
Please Log in or Create an account to join the conversation.
- VK
- Offline
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1181
- Thank you received: 157
unfortunately "EVAL" after "MATCHES" or "LIKE" gives jQL parse error.
Is it a one-time task or a regular one?
Cheers
VK
Please Log in or Create an account to join the conversation.
- VK
- Offline
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1181
- Thank you received: 157
1. Write and compile the jBC subroutine (check first that you don't have another subroutine with the same name):
SUBROUTINE LIST.CONV(ret_list, list_name)
*-------------------------------------------------------------------------
GETLIST list_name TO ret_list ELSE ret_list = '' ; RETURN
CHANGE @FM TO @VM IN ret_list
RETURN
END
2. Assuming that your list is named LD, run:
LIST FBNK.STMT.ENTRY WITH REPAYMENT.TYPE='IN' AND EVAL "TRANS.REFERENCE MATCHES LIST.CONV('LD')" EQ 1 ACCOUNT.NUMBER TRANSACTION.CODE VALUE.DATE
Cheers
VK
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
R10 on CentOS
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
R10 on CentOS
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
R10 on CentOS
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
But file stored in SAVEDLIST dir contains data like this:
PDLD1234567890
PDLD1234567891
Question: is it possible to run select using VK's solution but to get same results as: ...CONTRACT.NUMBER LIKE 'PDLD1234567890...'
p.s: I've tried to store PDLDs in file (in SAVEDLIST dir) like that:
PDLD1234567890...
PDLD1234567891...
It's returns "No records"
R10 on CentOS
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
SELECT FBNK.PD.PAYMENT.DUE$HIS WITH REPAYMENT.DATE>20150501 AND (REPAY.TYPE='IN' OR REPAY.TYPE='PR' OR REPAY.TYPE='CH') AND EVAL "EVAL'CONTRACT.NUMBER[3,12]' MATCHES LIST.CONV('stmnt_ld')" EQ 1 SAVING EVAL "CONTRACT.NUMBER:',':CUSTOMER:',':REPAYMENT.DATE:',':REPAY.TYPE:',':ORIG.STLMNT.ACT:',':REPAY.AMT:',':CURRENCY"
SAVE.LIST stmnt_PD.csv
"Error in attribute definition item EVAL'CONTRACT.NUMBER[3,12]' MATCHES LIST.CONV('stmnt_ld')"
R10 on CentOS
Please Log in or Create an account to join the conversation.
- VK
- Offline
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1181
- Thank you received: 157
If I understand you correctly, you need the following:
... AND EVAL "FIELD(CONTRACT.NUMBER,';',1) MATCHES ..." EQ 1
Cheers
VK
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
R10 on CentOS
Please Log in or Create an account to join the conversation.
- deeplay
- Topic Author
- Offline
- Junior Member
- Posts: 25
- Thank you received: 0
SELECT FBNK.PD.PAYMENT.DUE$HIS WITH REPAYMENT.DATE>20150221 AND (REPAY.TYPE='IN' OR REPAY.TYPE='PR' OR REPAY.TYPE='CH') AND EVAL "CONTRACT.NUMBER[3,12] MATCHES LIST.CONV('stmnt_ld')" EQ 1 SAVING EVAL "CONTRACT.NUMBER:',':CUSTOMER:',':REPAYMENT.DATE:',':REPAY.TYPE:',':ORIG.STLMNT.ACT:',':REPAY.AMT:',':CURRENCY"
p.s: FIELD(CONTRACT.NUMBER,';',1) — I've just read about this from "This is how it works" book ))) Thanks for sharing your skills and knowledge.
R10 on CentOS
Please Log in or Create an account to join the conversation.
- Winfred_Lubega
- Offline
- Senior Member
- Me
- Posts: 52
- Thank you received: 0
I am trying to extract data form the history table TELLER, but it comes with TT1111...;1, and when i use EQ it says no record found. How can i do it?
Please Log in or Create an account to join the conversation.
- VK
- Offline
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1181
- Thank you received: 157
post here the full text of your query...
Cheers
VK
Please Log in or Create an account to join the conversation.