Tuesday, September 28, 2010

Write to File in Temenos T24 Infobaic

In this quick tutorial we are going write a subroutine that will read a file in infobasic and then write some extracted values to a file which later can be used for data analysis to get some thoughtful information, or can be used to pass information to a legacy system.

In this tutorial we will open a file and read its ID by looping the file and save those ID to a Sequential File for later use.

Code Sample

SUBROUTINE PK.B.INTF.TUTORIALJINNI.DEMO

$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.FILENAME

 GOSUB INIT
 GOSUB PROCESS

RETURN

INIT:

*//* INITIALIZING VARIABLES ***

 FN.ACT = 'F.FILENAME'
 F.ACT = ''
  
 ID = ''
 ARR = ''

 ACT.ERR1 = ''
 SEL.CMD = ''
 SEL.LIST = ''
 NO.OF.REC = 0
 RETURN.CODE = '' 

RETURN

PROCESS:

*//****

 DIRECTORY.NAME="PATH.WHERE.TO.SAVE.FILE"
 FILE.NAME = "FILE.NAME"

 OPENSEQ DIRECTORY.NAME,FILE.NAME TO SEQ.FILE.POINTER ELSE
 CREATE SEQ.FILE.POINTER ELSE
 RETURN
 END
END

*//****

 CALL OPF(FN.ACT,F.ACT)

 SEL.CMD = "SELECT ":FN.ACT:"
 
 CALL EB.READLIST(SEL.CMD,SEL.LIST,'',NO.OF.REC,RETURN.CODE)
 
 IF NO.OF.REC GT 0 THEN
 
  LOOP

  REMOVE ID FROM SEL.LIST SETTING POS

  WHILE ID:POS

  CALL F.READ(FN.ACT,ID,ARR,F.ACT,ACT.ERR1)
  
  VALUE.ID =   ID
  
  TOFILE=VALUE.ID
  
  WRITESEQ TOFILE APPEND TO SEQ.FILE.POINTER THEN
  END
  
  REPEAT
 END
 CLOSESEQ SEQ.FILE.POINTER ;*// SEQUENTIAL FILE CLOSE 
 RETURN 
END

5 comments:

Anonymous said...

can u post write file using mulithread?

Originative on April 4, 2011 at 12:52 PM said...

you can use JBASETHREADCreate command to start a new thread...

method signature is...

JBASETHREADCreate(ProgramName, Arguments, User, Handle)

may it help you...

Originative on April 4, 2011 at 1:00 PM said...

you can also monitor status of threads running by issuing command JBASETHREADStatus(ThreadList)

Anonymous said...

Please share me how to get filename in routine without hardcode or parameterize ?

Anonymous said...

What about extract file from directory then upload the data to T24.

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems