Count Application/Table field

  • silvergem
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago #22278 by silvergem
Count Application/Table field was created by silvergem
Is there a simpler way to count the fields of an existing application. This is to get the audit fields dynamically(Inputter,co.code)

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Away
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
5 years 4 months ago - 5 years 4 months ago #22279 by VK
Replied by VK on topic Count Application/Table field
Hi
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
Last edit: 5 years 4 months ago by VK.

Please Log in or Create an account to join the conversation.

  • silvergem
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago #22280 by silvergem
Replied by silvergem on topic Count Application/Table field
No, Im inside on Service

Please Log in or Create an account to join the conversation.

  • silvergem
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago - 5 years 4 months ago #22281 by silvergem
Replied by silvergem on topic Count Application/Table field
Currently this is the one im using which I've replicated from one of the core code. I dont know whether this is optimized, can it be done using a select statement?
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>
Last edit: 5 years 4 months ago by silvergem.

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Away
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
5 years 4 months ago #22282 by VK
Replied by VK on topic Count Application/Table field
Hi
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
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago #22283 by silvergem
Replied by silvergem on topic Count Application/Table field
How can read the dictionary ? Ive tried EB.DICTIONARY

Please Log in or Create an account to join the conversation.

  • silvergem
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago #22284 by silvergem
Replied by silvergem on topic Count Application/Table field
The EB.EXECUTE.APPLICATION works. Ive tried the GET.STANDARD.SELECTION.DETS but it gave wrong value

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
Result

210

40
5241
5

250


Total count
Attachments:

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Away
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
5 years 4 months ago #22287 by VK
Replied by VK on topic Count Application/Table field
Hi

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
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago #22296 by silvergem
Replied by silvergem on topic Count Application/Table field
Is OPEN DICT a function? statement?

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Away
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
5 years 4 months ago #22298 by VK
Replied by VK on topic Count Application/Table field

Cheers
VK
The following user(s) said Thank You: silvergem

Please Log in or Create an account to join the conversation.

  • silvergem
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago #22299 by silvergem
Replied by silvergem on topic Count Application/Table field
    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
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
5 years 4 months ago #22300 by silvergem
Replied by silvergem on topic Count Application/Table field
Ive changed to
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
  • VK's Avatar
  • Away
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
5 years 4 months ago #22302 by VK
Replied by VK on topic Count Application/Table field
Good work!

Cheers
VK
The following user(s) said Thank You: silvergem

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #23717 by gopika
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.

More
2 years 6 months ago #23719 by gopika
@VK or anyone please help
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
  • VK's Avatar
  • Away
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
2 years 6 months ago #23721 by VK
Hi,
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?

123456*ABC1234*AB123*AB12*1001*1
if 123456 is available then it should go to 123457...

What means "go to"? Return its value?
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
The following user(s) said Thank You: silvergem

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #23725 by gopika
Hi,

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
  • VK's Avatar
  • Away
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
2 years 6 months ago #23726 by VK
Hi
> 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
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
2 years 6 months ago - 2 years 6 months ago #23727 by silvergem
Replied by silvergem on topic newbie to t24 don't know how to write routine
If you already have basic coding experience. You can already check the  JBC Functions  available based on your requirement. There is also 5 published books by  Vladimir Kazimirchik under Publications

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)
Last edit: 2 years 6 months ago by silvergem.

Please Log in or Create an account to join the conversation.

  • silvergem
  • silvergem's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
2 years 6 months ago #23728 by silvergem
Replied by silvergem on topic Count Application/Table field
After 2 years. I don't remember why I wrote this code LOL

Please Log in or Create an account to join the conversation.

Time to create page: 0.129 seconds