Count Application/Table field
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
Please Log in or Create an account to join the conversation.
- VK
- Away
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1183
- Thank you received: 157
are you inside a VERSION of this application? If yes, you can use Z variable that contains fields quantity. As audit trail is always formed the same way, you can easily find positions of your fields.
Cheers
VK
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
INIT:
DIM Y.FSAVE(C$SYSDIM) , Y.NSAVE(C$SYSDIM) , Y.TSAVE(C$SYSDIM)
Y.FILE.VAR = ''
CALL OPF(Y.FILE,Y.FILE.VAR)
Y.CHECK.FILE = FIELD(Y.FILE,'.',2,99)
RETURN
GET.APP.FIELD.COUNT:
* SAVE THE CURRENT F , N & T PARAMETERS , ONLY AS PRECAUTION
MAT Y.FSAVE = MAT F ; MAT Y.NSAVE = MAT N ; MAT Y.TSAVE = MAT T ; YSAVE.V = V
Y.FUNCTION = V$FUNCTION ; V$FUNCTION = 'RG.OBTAIN.OVERRIDE'
*
* CALL THE ROUTINE BY LENGTH OF FUNCTION > 1 , JUST TO GET THE V*
CALL @Y.CHECK.FILE
V.VAL = V ; * V VAL IS OBTAINED
*
* RESTORE THE F N & T PARAMETERS*
MAT F = MAT Y.FSAVE ; MAT N = MAT Y.NSAVE ; MAT T = MAT Y.TSAVE ; V = YSAVE.V
V$FUNCTION = Y.FUNCTION
RETURN
GET.APP.FIELD.DATA:
CALL F.READ (Y.FILE,Y.KEY,Y.REC,Y.FILE.VAR,ER)
IF ER THEN
Y.FILE = Y.FILE:'$HIS'
CALL F.READ.HISTORY(Y.FILE, Y.KEY, Y.REC, Y.FILE.VAR, ER )
END
Y.OVERIDE = Y.REC<V.VAL-9>
Y.REC.STAT = Y.REC<V.VAL-8>
Y.CUR.NO = Y.REC<V.VAL-7>
Please Log in or Create an account to join the conversation.
- VK
- Away
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1183
- Thank you received: 157
One addition: if you just call template subroutine, that won't work on new templates (V3+).
You can try to use:
CALL EB.EXECUTE.APPLICATION(app_name)
But much safer way is to call GET.STANDARD.SELECTION.DETS.
Another way is to read the dictionary and get field number in the dictionary field #2.
Cheers
VK
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
PROGRAM GET.APPLICATION.MAXFIELD.LENGTH.TEST
* SUBROUTINE GET.APPLICATION.MAXFIELD.LENGTH (Y.APP,Y.ERR)
$INSERT ../T24_BP I_COMMON
$INSERT ../T24_BP I_EQUATE
$INSERT ../T24_BP I_F.STANDARD.SELECTION
******************************
CALL LOAD.COMPANY('BNK')
INPUT Y.APP
*******************************
GOSUB INIT
GOSUB GET.APP.FIELD.COUNT
GOSUB GET.APP.FIELD.COUNT2
GOSUB GET.APP.FIELD.COUNT3
RETURN
INIT:
DIM Y.FSAVE(C$SYSDIM) , Y.NSAVE(C$SYSDIM) , Y.TSAVE(C$SYSDIM)
MAT Y.FSAVE = '' ; MAT Y.NSAVE = '' ; MAT Y.TSAVE = ''
Y.APPLICATION = FIELD(Y.APP,'.',2,99)
RETURN
GET.APP.FIELD.COUNT:
* SAVE THE CURRENT F , N & T PARAMETERS , ONLY AS PRECAUTION
MAT Y.FSAVE = MAT F ; MAT Y.NSAVE = MAT N ; MAT Y.TSAVE = MAT T ; YSAVE.V = V
Y.FUNCTION = V$FUNCTION ;
V$FUNCTION = Y.APPLICATION
* CALL THE ROUTINE BY LENGTH OF FUNCTION > 1 , JUST TO GET THE V*
* CALL @Y.APPLICATION
CALL EB.EXECUTE.APPLICATION(Y.APPLICATION)
V.VAL = V ; * V VAL IS OBTAINED
* RESTORE THE F N & T PARAMETERS*
MAT F = MAT Y.FSAVE ; MAT N = MAT Y.NSAVE ; MAT T = MAT Y.TSAVE ; V = YSAVE.V
V$FUNCTION = Y.FUNCTION
CRT V.VAL
CRT ''
RETURN
GET.APP.FIELD.COUNT2:
SS.FIELDS = ''
CALL GET.STANDARD.SELECTION.DETS(Y.APPLICATION, SS.FIELDS)
CRT DCOUNT(SS.FIELDS,@FM)
CRT DCOUNT(SS.FIELDS,@VM)
CRT DCOUNT(SS.FIELDS,@SM)
CRT ''
RETURN
GET.APP.FIELD.COUNT3:
R.STAND.SEL = ''
FN.STANDARD.SELECTION = 'F.STANDARD.SELECTION'
F.STANDARD.SELECTION = ''
CALL F.READ(FN.STANDARD.SELECTION, Y.APPLICATION, R.STAND.SEL, F.STANDARD.SELECTION, READ.ERR) ;* Try read from the disk
CRT DCOUNT(R.STAND.SEL<SSL.SYS.FIELD.NO>,VM)
RETURN
END
210
40
5241
5
250
Total count
Please Log in or Create an account to join the conversation.
- VK
- Away
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1183
- Thank you received: 157
how to read dictionary - use OPEN DICT to open a dictionary.
About "250" in your result - SS record contains not only data fields (so 210 looks like the correct result); it also contains I-descriptors etc.
Cheers
VK
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
Please Log in or Create an account to join the conversation.
- VK
- Away
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1183
- Thank you received: 157
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
OPEN "DICT", "F.ACCOUNT" TO F.DICT.FILE THEN
READ RECORD FROM F.DICT.FILE,"CO.CODE" THEN
CRT EREPLACE(RECORD,@FM,"-")
CRT "INDEX " : RECORD<2>
END
END ELSE
YERR = "CANNOT OPEN DICTIONARY FOR &":FM:APPL.ID
END
D-207--CO.CODE-11L-S
JBASE_EDICT_START-108---CO_CODE
1073741824
JBASE_EDICT_END
INDEX 207
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
OPEN "DICT", "F.ACCOUNT" TO F.DICT.FILE THEN
READ RECORD FROM F.DICT.FILE,"AUDIT.DATE.TIME" THEN
CRT EREPLACE(RECORD,@FM,"-")
CRT "INDEX " : RECORD<2>
END
END ELSE
YERR = "CANNOT OPEN DICTIONARY FOR &":FM:APPL.ID
END
to get the total count of field
Please Log in or Create an account to join the conversation.
- VK
- Away
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1183
- Thank you received: 157
Please Log in or Create an account to join the conversation.
- gopika
- Offline
- New Member
- Posts: 4
- Thank you received: 0
For Eg :
123456*ABC1234*AB123*AB12*1001*1
if 123456 is available then it should go to 123457...
Can you help me to write routine ?
Please Log in or Create an account to join the conversation.
- gopika
- Offline
- New Member
- Posts: 4
- Thank you received: 0
Can you please help me in writing a routine where i should open an input file then do for loop then check if id for example customer id is already available if available then increase it by count.
For Eg :
123456*ABC1234*AB123*AB12*1001*1
if 123456 is available then it should go to 123457...
Can you help me to write routine ?
Please Log in or Create an account to join the conversation.
- VK
- Away
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1183
- Thank you received: 157
I afraid writing a routine is your work :))
To be serious, did you started anything? Show your code and you'll get an advice. If you haven't yet started, please clarify: what's an "input file"? Is it a flat file or data file?
What means "go to"? Return its value?123456*ABC1234*AB123*AB12*1001*1
if 123456 is available then it should go to 123457...
What ABC1234 and others then for? Shall you proceed with them after 123456?
What if there's an ID without digits?
Last but not least - was it worth to post it 3 times - 2 here and another to very different theme?
Cheers
VK
Please Log in or Create an account to join the conversation.
- gopika
- Offline
- New Member
- Posts: 4
- Thank you received: 0
Sorry for the late reply and extremely sorry as I didn't know where to post so just posted wherever I can. sorry
I haven't started writing any routine. sorry. input file is where i give customer id which will be in digits only and others are mnemonic, short name and name 1, sector and language which are fields in customer record and that in input file each field will be separated by field marker.
the routine i should write is there will be a record , for eg :
123456*ABCD12*ABC12*AB12*1001*1
and if 123456 customer record already has it's field filled then it's available and that using "count" the customer id should get moved from 123456 to 123457 and that other field details may remain same.
Can you help me write this routine ? I know I should write but if possible can i have the full routine and next time these type of questions asking for full routines give won't be asked.
Please Log in or Create an account to join the conversation.
- VK
- Away
- Platinum Member
- Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
- Posts: 1183
- Thank you received: 157
> can i have the full routine
sorry I have no time to do other people's work; neither I am allowed to.
Firstly you need to learn how to create a "hello world" in T24 and then... hint: use OPENSEQ to open a flat file and READSEQ to read a line from it. Then we'll see to how to parse a line and how to check if a customer record exists.
Cheers
VK
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
If you dont have basic coding experience, you should take courses on programming. There is TLC online which is subscription based which guides you on functional./technical requirement offered by temenos
Also there are sample codes available on tcsp portal (request a tcsp access credentials) for TAFJ platform and for TAFC inside on your server (/opt/TAFC/RXX/samples/JQLBASIC)
Please Log in or Create an account to join the conversation.
- silvergem
- Topic Author
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
- Posts: 267
- Thank you received: 21
Please Log in or Create an account to join the conversation.