Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T24 topics #5

Merged
merged 18 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
265 changes: 265 additions & 0 deletions .rmv/logs/backup/rocket_mv_basic_language_server.2023-08-22-1.log

Large diffs are not rendered by default.

171 changes: 171 additions & 0 deletions .rmv/logs/backup/rocket_mv_basic_language_server.2023-08-24-1.log

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2023-08-25 17:58:33.277 [main] WARN com.rs.mv.mvvs.Startup - [LSP:100104]ROCKET MV BASIC EXTENSION exited
172 changes: 172 additions & 0 deletions .rmv/logs/backup/rocket_mv_basic_language_server.2023-08-26-1.log

Large diffs are not rendered by default.

435 changes: 175 additions & 260 deletions .rmv/logs/rocket_mv_basic_language_server.log

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions AutopopulateContentUsingSubroutine/VS.AcRandMnemonic.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SUBROUTINE VS.AcRandMnemonic


$INSERT T24.BP I_COMMON
$INSERT T24.BP I_EQUATE
$INSERT MARX.BP I_VS.COMMON

rand_mne = RND$Letters(4) : RND$Numbers(4) : RND$Letters(2)
IF R.NEW(AF) EQ '' THEN R.NEW(AF) = rand_mne

RETURN
END
6 changes: 6 additions & 0 deletions Create&MergeSavedlistsUsingJQLOnTAFC&SQLOnTAFJ/AcctList.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT TOP 10 [CO_CODE], [RECID] FROM V_FBNK_ACCOUNT WHERE WORKING_BALANCE > '0' AND CUSTOMER <> ''
UNION
SELECT TOP 10 [CO_CODE], [RECID] FROM V_FEUI_ACCOUNT WHERE WORKING BALANCE > '0' AND CUSTOMER <> ''
UNION
SELECT TOP 10 [CO_CODE], [RECID] FROM V_FSG1_ACCOUNT WHERE WORKING_BALANCE > '0' AND CUSTOMER <> ''
ORDER BY [CO_CODE];
9 changes: 9 additions & 0 deletions CreateField&UseInSubroutine/TestProg.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PROGRAM TestProg

mobile = '3525747565584'
acc_id = '45764'
txn = 'USD': @FM : 3249.90 : @FM : 'CR' :'Payment for training'

CALL VS.SendSMSAlert(mobile, acc_id, txn, text)
CRT text
END
31 changes: 31 additions & 0 deletions CreateField&UseInSubroutine/VS.SendSMSAlert.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
SUBROUTINE VS.SendSMSAlert(mobile, acc_id, txn, text)

$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.ACCOUNT

text = ''
dr_cr = 'debited from'

CALL VS.GetRecord('F.ACCOUNT', acc_id, acc_rec)
acc_name = acc_rec<Account_ShortTitle>

CALL GET.LOC.REF('ACCOUNT', 'SMS.ALERT', posn)
sms_alert = acc_rec<Account_LocalRef, posn>

IF sms_alert NE 'Y' THEN RETURN

currency = txn<1>
amount = txn<2>
details = txn<4>

IF txn<3> EQ 'CR' THEN dr_cr = 'credited to'

text = 'Hi ' : acc_name :', ' : currency : ' ' : amount : ' has been '
text := dr_cr : ' your account ': acc_id : '. Details: ': details

* Sending SMS
CRT 'Sending SMS to ' : mobile

RETURN
END
16 changes: 16 additions & 0 deletions CreatingLoggerInJBC/MX.Logger.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$PACKAGE MX.Training
SUBROUTINE MX.Logger(data, err)

err = ''

log_file = 'test_' : OCONV(DATE(), 'DG') : '.log'
log_line = OCONV(TIME(), 'MTS') : '|' : data

OPENSEQ '../bnk.log', log_file TO file_ptr THEN NULL

WHITESEQ log_line APPEND TO file_ptr ELSE err = 'ERROR: Failed to write to ': log_file

CLOSESEQ file_ptr

RETURN
END
12 changes: 12 additions & 0 deletions CreatingLoggerInJBC/MX.TestProg.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PROGRAM MX.TestProg

$USING MX.Training

PROMPT 'Enter a text to log: '
INPUT text
CRT

MX.Training.Logger(text, err)
IF err NE '' THEN CRT err ELSE CRT 'OK'

END
13 changes: 13 additions & 0 deletions CrossValidation&Restriction/VS.FTInpSameCurr.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SUBROUTINE VS.FTInpSameCurr


$INSERT T24.BP I_COMMON
$INSERT T24.BP I_EQUATE
$INSERT T24.BP I_F_FUNDS.TRANSFER

IF R.NEW(FT.DEBIT.CURRENCY) NE R.REN(FT.CREDIT.CURRENCY) THEN
ETEXT = "Debit and credit currencies are not the same"
END

RETURN
END
21 changes: 21 additions & 0 deletions JBCFunctions&Statements/TestProg.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PROGRAM TEST

*Program to change the delimiter '.' in phone to '-'

phone = "354.458.656.778"

CRT "---BEFORE---"
CRT "Phone : " : phone

*Function - used when want to save the original value
CRT "---FUNCTION---"
phone1 = CHANGE(phone, ",", "-")
CRT "Phone : " : phone
CRT "Phone1 : " : phone1

*Statement - used when we want to permanently change the original value
CRT "---STATEMENT---"
CHANGE "." TO "-" IN phone
CRT "Phone : " : phone

END
14 changes: 14 additions & 0 deletions LogDataWithAuthVersionRoutines/VS.AuthLogAcDetails.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SUBROUTINE VS.AuthLogAcDetails

$INSERT T24.BP I_COMMON
$INSERT T24.BP I_EQUATE
$INSERT T24.BP I_F.ACCOUNT

log_file = ID.NEW : '.log'
log_info = R.NEW(AC.MNEMONIC) : '*' : R.NEW(AC.SHORT.TITLE) : '*' :R.NEW(AC.CURRENCY)
log_info := '*' : R.NEW(AC.CATEGORY) : '*': OPERATOR

CALL VS.Logger(log_file, log_info, 'INFO', ret_code)

RETURN
END
14 changes: 14 additions & 0 deletions Multithreading/GREETING.SVC.LOAD.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SUBROUTINE GREETING.SVC.LOAD


$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_GREETING.SVC.COMMON

fn_cust = 'F.CUSTOMER'
f_cust = ''
CALL OPF(fn_cust, f_cust)

RETURN

END
14 changes: 14 additions & 0 deletions Multithreading/GREETING.SVC.SELECT.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SUBROUTINE GREETING.SVC.SELECT


$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_GREETING.SVC.COMMON

sel_cmd = 'SELECT ' : fn_cust
CALL EB.READLIST(sel_cmd, sel_list, '', total_rec, ret_code)
CALL BATCH.BUILD.LIST('', sel_list)

RETURN

END
16 changes: 16 additions & 0 deletions Multithreading/GREETING.SVC.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SUBROUTINE GREETING.SVC(cust_id)



$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.CUSTOMER
$INSERT MARX.BP I_GREETING.SVC.COMMON

CALL OCOMO('Processing... ': cust_id)

CALL.F.READ(fn_cust, cust_id, cust_rec, f_cust, err)
IF cust_rec EQ '' THEN
CALL OCOMO('Error: No customer record found with id ' : cust_id)
RETURN
END
5 changes: 5 additions & 0 deletions Multithreading/I_GREETING.SVC.COMMON
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
COMMON /GREETING.SVC/ fn_cust,
f_cust,
cust_rec,
err,
sel_list
14 changes: 14 additions & 0 deletions ProduceJsonData&ProcessSavedlists/VS.GetAcctDetails.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SUBROUTINE VS.GetAcctDetails(acct_id, details)

$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.ACCOUNT

details = '{}'

CALL VS.GetRecord('F.ACCOUNT', acct_id, rec)
details = '{ "id": "' : acct_id : '", "name": "' : rec<AC.SHORT.TITLE> : '", "currency": "'
details := rec<AC.CURRENCY> : '", "balance": ' : rec<AC.WORKING.BALANCE> : '}'

RETURN
END
29 changes: 29 additions & 0 deletions ProduceJsonData&ProcessSavedlists/VS.ProcessAcctList.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PROGRAM VS.ProcessAcctList

PROMPT "Enter the name of the list: "
INPUT list_name

IF NOT(list_name) THEN STOP

READLIST acc_list FROM list_name ELSE
CRT 'List with name ' : list_name : ' does not exist!'
STOP
END


account_list = '[ '
LOOP
WHILE READNEXT rec FROM acc_list DO
company_code = rec[1, 9]
acct_id = rec[11, 99]

CALL VS.GetAcctDetails(acct_id, details)
account_list<-1> = details : ','
CRT rec
REPEAT

account_list[1] = ' ]'

CRT account_list

END
14 changes: 14 additions & 0 deletions ReadingFilesInJBC/ReadFile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PROGRAM VS.ReadFile

dir = '../bnk.interface/EBANK.IN'
filename = 'transaction.csv'

OPENSEQ dir, filename TO ptr THEN
LOOP
READSEQ line FROM ptr ELSE BREAK
CRT line
REPEAT
END ELSE CRT 'Failed to open ': filename

CLOSESEQ ptr
END
9 changes: 9 additions & 0 deletions TransitionFromTAFCToTAFJ/EB.MtdTraining.component
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
component EB.MtdTraining

# Component Isolation Definition
metamode1Version 1.6
# -----------------------------------------
public method VSGetAcctDetails(IN acct_id string, OUT details string)
{
JBC : VS.GetAcctDetails
}
25 changes: 25 additions & 0 deletions TransitionFromTAFCToTAFJ/TestGetAcctDetails.tut
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
TESTCASE TestGetAcctDetails
$USING AC.AccountOpening

UTF.setTarget("EB.MtdTraining.VSGetAcctDetails")
UTF.setDescription("Unit test to get account details in a JSON object")

id = "89787"
record = ""
record<AC.AccountOpening.Account.ShortTitle> = "John Smith"
record<AC.AccountOpening.Account.Currency> = "USD"
record<AC.AccountOpening.Account.WorkingBalance> = "255565.23"

UTF.setRecord("F.ACCOUNT", id, record)

UTF.addParam(id)
UTF.addParam(details)

UTF.runTest()

expected = '{ "id": "89787", "name": "JohnSmith", "currency": "USD", "balance": 25564.23}'

UTF.assetEquals(details, expected)

RETURN
END
15 changes: 15 additions & 0 deletions TransitionFromTAFCToTAFJ/VS.GetAcctDetails.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$PACKAGE EB.MtdTraining
SUBROUTINE VS.GetAcctDetails(acct_id, details)

$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.ACCOUNT

details = '{}'

CALL VS.GetRecord('F.ACCOUNT', acct_id, rec)
details = '{ "id": "' : acct_id : '", "name": "' : rec<AC.SHORT.TITLE> : '", "currency": "'
details := rec<AC.CURRENCY> : '", "balance": ' : rec<AC.WORKING.BALANCE> : '}'

RETURN
END
29 changes: 29 additions & 0 deletions TransitionFromTAFCToTAFJ/VS.ProcessAcctList.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PROGRAM VS.ProcessAcctList

PROMPT "Enter the name of the list: "
INPUT list_name

IF NOT(list_name) THEN STOP

READLIST acc_list FROM list_name ELSE
CRT 'List with name ' : list_name : ' does not exist!'
STOP
END


account_list = '[ '
LOOP
WHILE READNEXT rec FROM acc_list DO
company_code = rec[1, 9]
acct_id = rec[11, 99]

IF company_code NE ID.COMPANY THEN CALL LOAD.COMPANY(company_code)
CALL VS.GetAcctDetails(acct_id, details)
account_list := details : ','
REPEAT

account_list[1] = ' ]'

CRT account_list

END
13 changes: 13 additions & 0 deletions ValidateUserInput&DefaultValues/VS.ValDefaultMnemonic.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SUBROUTINE VS.ValDefaultMnemonic


$INSERT T24.BP I_COMMON
$INSERT T24.BP I_EQUATE
$INSERT T24.BP I_F.ACCOUNT
$INSERT MARX.BP I_VS.COMMON

rand_mne = RND$Letters(4) : COMI
IF R.NEW(AC.MNEMONIC) EQ '' THEN R.NEW(AC.MNEMONIC) = rand_mne

RETURN
END
10 changes: 10 additions & 0 deletions ValidateUserInput&DefaultValues/VS.ValSavingsAc.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SUBROUTINE VS.ValSavingsAc


$INSERT T24.BP I_COMMON
$INSERT T24.BP I_EQUATE

IF NOT (COMI MATCHES "'6'3N") THEN ETEXT = 'AC-CATEG.NOT.SAVING'

RETURN
END
Loading
Loading