70
8/18/2019 Infobasic Programming http://slidepdf.com/reader/full/infobasic-programming 1/70 T2BTT – R06 – 1.0  Copyr ight 2005 TEMENOS HEADQUARTERS SA1 Infobasic Programming  

Infobasic Programming

Embed Size (px)

Citation preview

Page 1: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 1/70

T2BTT – R06 – 1.0   Copyr ight  2005 TEMENOS HEADQUARTERS SA1

Infobasic Programming

 

Page 2: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 2/70

T2BTT – R06 – 1.0   Copyr ight  2005 TEMENOS HEADQUARTERS SA2

 Agenda

 Introduction to Infobasic

  Arrays and types of arrays

 Introduction to subroutines and programs

 

Important functions/commands in Infobasic

 Steps to create a subroutine in T24

 Compiling and cataloguing routines and programs

 T24 routines – file operations

 

T24 routines – sequential file access

 T24 – Creation of functions and routines it! arguments

 

Page 3: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 3/70

Introduction To Infobasic

 Programming language used for T24

 Simple – "nglis! li#e statements

 $o declaration of %ariables required

 

$o data type specification is required

  All %ariables by default !a%e infinite %ariable lengt!

 –   Muti !"u#

 – Su$ %"u#

Page 4: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 4/70

 Arrays

 Continuous allocation of bytes

  All bytes in an array !a%e t!e same name as t!at of t!e

array

 

"ac! byte is uniquely identified it! t!e !elp of asubscript&

T "   ' "   $ ( S

) 1 2 * 4 + ,

Page 5: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 5/70

 Arrays In Infobasic

 -ynamic Arrays –   Dy&"'i( i& &"tur#

 – %"r i"$# #&gth

 –   N##) &ot $# )#("r#)

 –   C"& ho) "&y typ# o*  )"t" –   Auto'"ti("y i&(r#"+# or  )#(r#"+# i& +i,# )#p#&)i&g o& th#

)"t"

 –   A !"r i"$#+ i& -&* o$"+i( "r# )y&"'i( "rr"y+

 -imensioned arrays –   H"!# " * i.#) &u'$#r  o*  r o/+ "&) (ou'&+

 –   C"& ho) "&y typ# o*  )"t"

 –   N##)+ to $# )#("r#)

 –   U+#) /h#& )i'#&+io&+ "&) #.t#&t+ "r# &o/& "&) "r# &oti#y to (h"&g#

Page 6: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 6/70

-ynamic Array

C.ST('"&$A'" 0

AT" 0 )

-AT" 0 31212)2

Can store any type and any amount of data&

(nly initialisation is required&

Page 7: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 7/70

 Arrays

-ynamic Arrays 5Cont&6

 – U+#+ )#i'it#r+ to +tor# )"t" o* !"riou+ *i#)+

ASC-- D#(i'" D#+(riptio&

25 i#) M"r#r  

253 %"u# M"r#r  

252 Su$4%"u# M"r#r  

Page 8: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 8/70

Sample ecord 7rom T!e T"'"$(S&T8

1 $ame

2&1 Address

2&2 Address

2&* Address

*&1 Course Category

4&1&1 Course $ame

4&1&2 Course $ame

*&2 Course Category

4&2&1 Course $ame4&2&2 Course $ame

+ 7ree Te9t

, Inputter 

TemenosTrg

India

.:

8ene%a

Tec!nical

 ;<AS"

T24

7unctional

=ending7inancials

T/ AI$"/&1

Page 9: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 9/70

>o ill t!is record get stored in a dynamic array?

Page 10: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 10/70

T2BTT – R06 – 1.0

Storage In A -ynamic Array

TemenosTrgMIndia%M.:%M8ene%aMTec!nical%M7unctionalM

 ;<AS"SMT24%M=endingSM7inancialsMMTrainer&1Copyr ight  2005 TEMENOS 

HEADQUARTERS S1A)

 

Page 11: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 11/70

-imensioned Array

-I' AA@154*6

4 – os

* – Columns

Copyr ight  2005 TEMENOS 

HEADQUARTERS S1A1

Page 12: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 12/70

-imensioned Array 5Cont&6

-I' AA@2546

4 – os

.nlimited columns 5"ac! ro ill be a dynamic array6Copyr ight  2005 TEMENOS 

HEADQUARTERS S1A2

Page 13: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 13/70

Page 14: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 14/70

lib&so&1

lib&so&2

Compiling And Cataloguing outines

"<&C('PI=" T8&<P T8&T$1

C('PI=" CATA=(8

C!ec# for errors

"rror – "9it

$o "rror 

Produce ob;ect codeBT8&T$1

T8&<P

BT8&T$1

C!ec# <C-"DE=I<

<C-"DE=I<0 B>('"/lib

B>('"/lib

Is t!ere place !ere

Is t!ere place !ereCopyr ight  2005 TEMENOS  HEADQUARTERS S1A4

Page 15: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 15/70

Compiling And Cataloguing Programs

"<&C('PI=" T8&<P T8&P81

C('PI=" CATA=(8

C!ec# for errors

"rror – "9it

$o "rror 

Produce e9ecutableBT8&P81

T8&<P

BT8&P81

C!ec# <C-"DE<I$

<C-"DE<I$0 B>('"/bin

B>('"/bin

T8&P81Copyr ight  2005 TEMENOS 

HEADQUARTERS S1A+

Page 16: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 16/70

"9ecuting outines

=ogin into T24

'a#e an entry int!e P8'&7I="

 At t!e command lineT8&T$1

<C(<"CT=IST 0B>('"/globuslibFB>('"/lib

"9ecute t!eroutine

Copyr ight  2005 TEMENOS  HEADQUARTERS S1A,

Page 17: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 17/70

"9ecuting Programs

8o to t!edatabase prompt

 ;s!&&G T8&P81

PAT> 0&FB>('"/globusbinFB>('"/binFBPAT>

"9ecute t!eprogram

Copyr ight  2005 TEMENOS  HEADQUARTERS S1AH

Page 18: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 18/70

riting A Simple Infobasic Program

Program to display >ello orld

#E" TRG$BP %E&&O

PROGRAM %E&&O

CRT '%e((o )or(+EN"

Copyr ight  2005 TEMENOS 

HEADQUARTERS S1AJ

Page 19: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 19/70

Compile And "9ecute T!e Program

 Compile and catalog

"<&C('PI=" T8&<P >"==(

 

"9ecute t!e program

 ;s!&&G>"==(

>ello orldCopyr ight  2005 TEMENOS 

HEADQUARTERS S1AK

Page 20: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 20/70

or+hop 1Copyr ight  2005 TEMENOSHEADQUARTERS S2A)

Page 21: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 21/70

Control Structures

 I7 T>"$ "=S"

I, <-onition> T%EN

<statements>

EN"

E&SE

<statements>EN"

Copyr ight  2005 TEMENOS HEADQUARTERS S2A1

Page 22: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 22/70

 <"8I$ CAS" L "$- CAS"

BEGIN CASE

CASE <.ariab(e> / <.a(ue><statements>

CASE <.ariab(e> / <.a(ue>

<statements>

CASE <.ariab(e> / <.a(ue>

<statements>CASE 1

<statements>

EN" CASECopyr ight  2005 TEMENOS 

HEADQUARTERS S2A2

Page 23: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 23/70

 7(

,OR <.ariab(e> / <initia(.a(ue> TO <ma0imum.a(ue><statements>

NET <.ariab(ename>Copyr ight  2005 TEMENOS 

HEADQUARTERS S2A*

Page 24: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 24/70

 (pen =oop

&OOP

CRT 'In2ut Numbers+INPUT 3$NUM1INPUT 3$NUM

)%I&E 3$NUM143$NUM

CRT 'Tota( ' 4 3$NUM1 5 3$NUM

REPEAT Copyr ight  2005 TEMENOS 

HEADQUARTERS S2A4

 

Page 25: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 25/70

="$5e6 =engt!

C(.$T5ed6

C>A$8"5edc6 C!ange

(C($D5ed6 Con%ert

<uilt In Infobasic 7unctions

of t!e te9t in e9pression

$umber of occurrences of d in e

  -C(.$T5ed6 $umber of occurrences of d in e M1

.PCAS"5e6 Con%erts e to uppercase

-($CAS"5e6 Con%erts e to loercase

occurrences of d to c in e

e into t!e format specified in dCopyr ight  2005 TEMENOS 

HEADQUARTERS S2A+

Page 26: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 26/70

Structure (f A Subroutine

SUBROUTINE SubroutineName

6INSERT I7COMMON

6INSERT I7E8UATE

A-tua( Statements

A-tua( Statements

RETURN

EN"Copyr ight  2005 TEMENOS 

HEADQUARTERS S2A,

Page 27: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 27/70

Insert 7iles

 IEC(''($

 –   D#* i&#+ " (o''o& !"r i"$#+

 IE"N.AT"

 – Eu"t#+ " &u'$#r  o*  (o''o& !"r i"$#+

 Insert files are a%ailable under 8=(<.S&<P

 Common %ariables get loaded !en a user signs on

 Some common %ariables are loaded !en specific

applications are opened/specific actions are performed

"9ample O &.S" I-&$"Copyr ight  2005 TEMENOS  HEADQUARTERS S2AH

Page 28: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 28/70

"9ample 2

rite a subroutine t!at ill display t!e details

5Id 'nemonic and $ationality6of a customer !ose id is 1))),KCopyr ight  2005 TEMENOS 

HEADQUARTERS S2AJ

Page 29: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 29/70

 Algorit!m

 

Step 1& (pen t!e Customer 7ile

 Step 2& ead t!e Customer file and e9tract t!e record

it! id 1))),K Step *& 7rom t!e e9tracted record obtain t!e mnemonic

and nationality

 Step 4& -isplay t!e customer idmnemonic and

nationality&Copyr ight  2005 TEMENOS 

HEADQUARTERS S2AK

Page 30: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 30/70

(pen A 7ile

 .se t!e command (P"$

(P"$ 7<$:&C.ST('"LL&

<utLL&Copyr ight  2005 TEMENOS 

HEADQUARTERS S*A)

Page 31: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 31/70

(pen A 7ile 5Cont&6

 (P7 – (pen 7ile

CA&& OP,9,N$CUS:,$CUS;

,N$CUS / ,$CUSTOMER= 9,i(e Name;

,$CUS / = 9,i(e Pat;Copyr ight  2005 TEMENOS 

HEADQUARTERS S*A1

Page 32: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 32/70

ead A 7ile

.se t!e 8lobus subroutine

1  7ile name

2  I- of t!e record to be read

C A== 7&/"A-512*4+6

*  -ynamic array t!at ill !old t!e read record

4  7ile Pat!

+  – "rror  Dariable

CA&& ,$REA"9,N$CUS:+1???@+:R$CUST OMER:,$CUS:CUS$ERR1;

7&/"A- alays c!ec#s if t!e record is in cac!e& If yes f etc!es t!e record f romt!e cac!e else retrie%es t!e record f rom t!e databse&

Copyr ight  2005 TEMENOS 

HEADQUARTERS S*A2

Page 33: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 33/70

ecord eturned <y 7&"A-

Co&t#&t+ o* R.CUSTOMER- A(>"$8<:Q- A(  >"$8  <A$:  I$CQ- A(  >"$8  <A$:  I$CQQ11K   ASI A$  ' A$SI($  2)K-"= A  /(SA  STQ  ="8 ASPI  DI== A8"  ' A:ATI  CIT@  ' A$  P>  QQQQ  1111QK)QQJ1))QKKKQP>Q4Q  P>Q  2))))1)1  QQQQQ  2))))1)1QQQ1QQQQQQQQQQQQQQQQQ1Q1JE /IC:<A$ AT1R2JE  A$-/"A<A/$"S1Q))),121)42Q1JE /I

C:<A$ AT1Q.S))1)))1Q1QQCopyr ight  2005 TEMENOS 

HEADQUARTERS S*A*

Page 34: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 34/70

"9tract Dalues

&C.ST('"1G

&C.ST('"1+G

!at !appens after an upgrade?Copyr ight  2005 TEMENOS 

HEADQUARTERS S*A4

Page 35: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 35/70

IE7&C.ST('" 7ileCopyr ight  2005 TEMENOS 

HEADQUARTERS S*A+

Page 36: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 36/70

-isplay Parts (f A ecord

3$MNEMONIC / R$CUSTOMER<EB$CUS$MNEMONIC>3$NATIONA&IT3 / R$CUSTOMER<EB$CUS$NATIONA&IT3>Copyr ight  2005 TEMENOS 

HEADQUARTERS S*A,

Page 37: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 37/70

-isplay Parts (f A ecord5Cont&6

CRT 'Customer I4 '43$CUS$I"

CRT 'Customer Mnemoni-4 '43$MNEMONICCRT 'Customer Nationa(it4 '43$NATIONA&IT3

Copyr ight  2005 TEMENOS 

HEADQUARTERS S*AH

Page 38: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 38/70

Solution 2

*Subroutine to is2(a te etai(s o -ustomer 1???@SUBROUTINE CUS$"ISP&A3$"ETAI&S6INSERT I7COMMON6INSERT I7E8UATE6INSERT I7,$CUSTOMERGOSUB INIT 

GOSUB OPEN,I&ESGOSUB PROCESSRETURNINIT4

,N$CUS / ,$CUSTOMER=,$CUS / =3$CUS$I" / 1???@

3$MNEMONIC / =3$NATIONA&IT3 / =R$CUSTOMER / =CUS$ERR1 / =

RETURNCopyr ight  2005 TEMENOS 

HEADQUARTERS S*AJ

Page 39: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 39/70

Solution 2 5Cont&6

OPEN,I&ES4

CA&& OP,9,N$CUS:,$CUS;

RETURN

PROCESS4

CA&& ,$REA"9,N$CUS:3$CUS$I":R$CUSTOMER:,$CUS:CUS$ERR1;

3$MNEMONIC / R$CUSTOMER<EB$CUS$MNEMONIC>

3$NATIONA&IT3 / R$CUSTOMER<EB$CUS$NATIONA&IT3>

CRT 'Customer I4 '43$CUS$I"

CRT 'Customer Mnemoni-4 '43$MNEMONIC

CRT Customer Nationa(it4 '43$NATIONA&IT3

RETURN

EN"Copyr ight  2005 TEMENOS 

HEADQUARTERS S*AK

Page 40: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 40/70

Solution 2

 Compile and catalog t!e routine – EB.COM7-8E TR9.B7 CUS.D-S78A :.DETA-8S

 'a#e an entry in t!e P8'&7I=" it! t!e type set to '&

 "9ecute t!e routine from t!e command line&Copyr ight  2005 TEMENOS 

HEADQUARTERS S4A)

Page 41: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 41/70

-ebugging LL&

 See t!e e9ecution of t!e routine line by line

 Insert t!e -"<.8 statement any!ere in t!e routine

Subroutine to is2(a te etai(s o -ustomer 1???@

SUBROUTINE CUS$"ISP&A3$"ETAI&S

6INSERT I7COMMON

6INSERT I7E8UATE

6INSERT I7,$CUSTOMER

GOSUB INIT 

GOSUB OPEN,I&ES

GOSUB PROCESS

RETURN

INIT4

"EBUG,N$CUS / ,$CUSTOMER=

,$CUS / =

3$CUS$I" / 1???@Copyr ight  2005 TEMENOS 

HEADQUARTERS S4A1

Page 42: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 42/70

-ebuggingLLL&

Sour-e -ange* to BPDCUS$"ISP&A3$"ET AI&S

??11 "EBUG

 EBASE *ebuggerF>S

??1 ,N$CUS / G,$CUST OMERG

 EBASE *ebuggerF>S

??1! ,$CUS / GG

 EBASE *ebuggerF>S??1H 3$CUS$I" / 1?!

 EBASE *ebuggerF>S

??1J 3$MNEMONIC / GG

 EBASE *ebuggerF>S

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

??! PROCESS4

 EBASE *ebuggerF>K  ,N$

CUS,N$CUS   4 ,BNL$CUST OMER

 EBASE *ebuggerF>K ,$CUS

,$CUS 4 ,i(e G$$Dmb*emo$*ataDstD,BNL$CUST ???GCopyr ight  2005 TEMENOS 

HEADQUARTERS S4A2

Page 43: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 43/70

or+hop 2Copyr ight  2005 TEMENOS

HEADQUARTERS S4A*

Page 44: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 44/70

"9ample *

'odify e9ample 2 to display t!e mnemonic and nationality of all t!ecustomers

Copyr ight  2005 TEMENOS 

HEADQUARTERS S4A4

Page 45: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 45/70

 Algorit!m

 

Step 1& (pen t!e Customer 7ile

 

Step 2& Select all t!e customer ids

 Step *& emo%e one customer id from t!e selected list

 Step 4& 7or t!e e9tracted customer id e9tract t!e

corresponding record from t!e customer file

 Step +& 7rom t!e e9tracted record e9tract t!e mnemonic and

nationality

 

Step ,& -isplay t!e customer id mnemonic and nationality

 epeat Steps * to , for all customersCopyr ight  2005 TEMENOS  HEADQUARTERS S4A+

Page 46: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 46/70

Select

  Assign t!e select statement to a %ariable

 S"=&C'- 0 3S"="CT 3O7$&C.SNote the space

 

.se t!e 8lobus subroutine "<&"A-=IST to e9ecute t!eselect statement

 .se SS"="CT instead of S"="CT if you ant data in a

sorted order Copyr ight  2005 TEMENOS 

HEADQUARTERS S4A,

Page 47: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 47/70

"<&"A-=IST

CA== "<&"A-=IST512*4+6

 1 Select Statement To <e "9ecuted

 2 A dynamic array t!at ill !old t!e ids of all records

selected separated by field mar#ers& * 7ile t!at ill !old t!e results of t!e select

statement5(ptional6

 4 Dariable t!at ill !old t!e number of records

selected + eturn Code

Copyr ight  2005 TEMENOS 

HEADQUARTERS S4AH

Page 48: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 48/70

"<&"A-=IST 5Cont&6

CA&& EB$REA"&IST9SE&$CM":SE&$&IST:==:NO$O,$REC:RET$CO"E;Copyr ight  2005 TEMENOS 

HEADQUARTERS S4AJ

Page 49: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 49/70

Insig!t Into "<&"A-=IST – "9ecute Select

SE&$CM" / 'SE&ECT '4,N$CUS4+ )IT% SECTOR > 1???+

CA&& EB$REA"&IST9SE&$CM":SE&$&IST:==:NO$O,$REC:RET$CO"E;

>o does "<&"A-=IST e9ecute t!is S"="CT statement?

 

Pic#s up t!e S"="CT statement

 Performs an ""C.T" S"=&C'- and store t!e output

on to S"=&=ISTCopyr ight  2005 TEMENOS HEADQUARTERS S4AK

Page 50: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 50/70

Insig!t Into "<&"A-=IST Internal Select

SE&$CM" / 'SE&ECT '4,N$CUSCA&& EB$REA"&IST9SE&$CM":SE&$&IST:==:NO$O,$REC:RET$CO"E;

>o does "<&"A-=IST e9ecute t!is S"="CT statement?

 

Pic#s up t!e S"="CT statement

 

ealiUes t!at t!ere are &o (o&)itio&+ and &o +ort#) +##(t

in S"=&C'- 

Performs an (P7 for t!e file t!at you is! to select

 

CA== (P757$&C.S&7&C.S6

 

Performs S"="CT 7&C.S

 – T!is is faster t!an ""C.T" S"=&C'- as it is not actuallyselecting t!e file

 – It is only positioning t!e file pointer to t!e start of t!e file and t!enill e9tract one I- after anot!er and store it in S"=&=IST

Copyr ight  2005 TEMENOS 

HEADQUARTERS S+A)

Page 51: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 51/70

Insig!t Into "<&"A-=IST Internal Select

 .se t!e facility of internal select in "<&"A-=IST !en

 –  :ou /i+h to pr o(#++ 'o+t o*  th# r#(or )+ o*  " * i#

 –  :ou )o &ot /"&t r#(or )+ i& " +ort#) or )#r Copyr ight  2005 TEMENOS HEADQUARTERS S+A1

Page 52: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 52/70

epeating A Set (f Statements

.se =((P and "'(D"5-iscussed "arlier6 to repeatSteps * to ,Copyr ight  2005 TEMENOS 

HEADQUARTERS S+A2

Page 53: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 53/70

Solution *

*Subroutine  to is2(a B  te mnemoni- an nationa(it B  o   a(( -ustomers

SUBROUT INE CUS$"ISP&A3$"ET AI&S6INSERT   I7 COMMON6INSERT  I7E8UAT E6INSERT   I7,$CUST OMER

"EBUGGOSUB INIT GOSUB OPEN,I&ES

GOSUB PROCESSRET URNINIT 4

,N$CUS /  G,$CUST OMERG,$CUS /  GG3$CUS$I" /  GGR$CUST OMER /  G<CUS$ERR1 /  GG3$MNEMONIC / 

GG3$

NAT IONA&IT 3 /  GGSE&$CM" /  GGSE&$&IST  /  GGNO$O,$REC / ?RET $CO"E /  GGRET URN

Copyr ight  2005 TEMENOS 

HEADQUARTERS S+A*

Page 54: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 54/70

Solution * 5Contd&6

OPEN,I&ES4CA&& OP,9,N$

CUS:,$

CUS;RET URNPROCESS4

SE&$CM" /  MSE&ECT  M4,N$CUSCA&& EB$REA"&IST 9SE&$CM":SE&$&IST :GG:NO$O,$REC:RET $CO"E;

&OOPREMOKE 3$

CUS$

I" ,ROM SE&$

&IST   SETT ING POS)%I&E 3$CUS$I"4POS

CA&& ,$REA"9,N$CUS:3$CUS$I":R$CUST OMER:,$CUS:CUS$ERR1;3$MNEMONIC / R$CUST OMER<EB$CUS$MNEMONIC>

3$NAT IONA&IT 3 /   R$CUST OMER<EB$CUS$NAT IONA&IT 3>CRT  MCustomer  I*4  M43$CUS$I"CRT  MCustomer  Mnemoni-4  M43$MNEMONICCRT  MCustomer  Nationa(it B4  M43

$

NAT IONA&IT 3REPEAT 

RET URN

EN"Copyr ight  2005 TEMENOS 

HEADQUARTERS S+A4

Page 55: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 55/70

Solution *

  Add a -"<.8 statement in t!e routine

 Compile and catalog t!e routine

 'a#e an entry in t!e P8'&7I=" it! t!e type set to '&

 "9ecute t!e routine from t!e command line&Copyr ight  2005 TEMENOS 

HEADQUARTERS S+A+

Page 56: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 56/70

or+hop 3Copyr ight  2005 TEMENOS

HEADQUARTERS S+A,

Page 57: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 57/70

"9ample 4

 Amend e9ample * to store t!e e9tracted all t!e customer Ids t!eir 

mnemonics and nationalities in a dynamic array in t!e folloingformat

CusIdV'nemonicV$ationalityMCusIdV'nemonicV$ationalityCopyr ight  2005 TEMENOS 

HEADQUARTERS S+AH

Page 58: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 58/70

 Algorit!m

 

Step 1& (pen t!e Customer 7ile

 

Step 2& Select all t!e customer ids

 

Step *& emo%e one customer id from t!e selected list

 

Step 4& 7or t!e e9tracted customer id e9tract t!e

corresponding record from t!e customer file

 

Ste2 J$ ,rom te e0tra-te re-or e0tra-t te

mnemoni- an nationa(itCopyr ight  2005 TEMENOS 

HEADQUARTERS S+AJ

Page 59: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 59/70

 Algorit!m

 Step ,& Store t!e customer id mnemonic and t!e

nationality in a dynamic array

 

epeat Steps * to , for all customersCopyr ight  2005 TEMENOS 

HEADQUARTERS S+AK

Page 60: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 60/70

 Append -ata In An Array

 AA@1G 0 $eDalue

 AA@1G 0 @&C.S&I-OVO@&'$"'($ICOVO@&$ATI($A=IT@Copyr ight  2005 TEMENOS 

HEADQUARTERS S,A)

Page 61: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 61/70

 Append -ata In An Array 5Cont&6

!at if an array delimited it! D's need to formed?

 AA@11G 0 Dalue

!at if an array delimited it! S's need to be formed?

 AA@111G 0 DalueCopyr ight  2005 TEMENOS 

HEADQUARTERS S,A1

Page 62: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 62/70

Solution 4*Subroutine  to store  te  i: mnemoni- an nationa(it B  o a(( *-ustomers in an arra B

SUBROUT INE CUS$

"ISP&A3$

"ET AI&S6INSERT   I7 COMMON6INSERT  I7E8UAT E6INSERT   I7,$CUST OMER

GOSUB INIT GOSUB OPEN,I&ESGOSUB PROCESSRET URN

INIT 4,N$CUS /  G,$CUST OMERG,$CUS /  GG3$CUS$I" /  G<R$CUST OMER /  GGCUS$ERR1 /  GG3$MNEMONIC /  GG3$NAT IONA&IT 3 /  GG

SE&$

CM" /  GGSE&$&IST  /  GGNO$O,$REC /  ?RET $CO"E /  GGCUS$"ET AI&S$ARRA3 /  GGRET URN

Copyr ight  2005 TEMENOS 

HEADQUARTERS S,A2

Page 63: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 63/70

Solution 4 5Cont&6

OPEN,I&ES4

CA&& OP,9,N$

CUS:,$

CUS;RET URN

PROCESS4

SE&$CM" /  MSE&ECT  M4,N$CUSCA&& EB$REA"&IST 9SE&$CM":SE&$&IST :GG:NO$O,$REC:RET $CO"E;

&OOPREMOKE 3$CUS$I" ,ROM SE&$&IST  SETT ING POS

)%I&E 3$CUS$I"4POSCA&& ,$REA"9,N$CUS:3$CUS$I":R$CUST OMER:,$CUS:CUS$ERR1;3$MNEMONIC / R$CUST OMER<EB$CUS$MNEMONIC>3$NAT IONA&IT 3 / R$CUST OMER<EB$CUS$NAT IONA&IT 3>CUS$"ET AI&S$ARRA3<F1> /

3$CUS$I"4G*G43$MNEMONIC4G*G43$NAT IONA&IT 3

REPEATRET URN

EN"Copyr ight  2005 TEMENOS 

HEADQUARTERS S,A*

Page 64: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 64/70

Solution 4

  Add a -"<.8 statement in t!e routine

 Compile and catalog t!e routine

 'a#e an entry in t!e P8'&7I=" it! t!e type set to '&

 "9ecute t!e routine from t!e command line&Copyr ight  2005 TEMENOS 

HEADQUARTERS S,A4

Page 65: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 65/70

or+hop  

Page 66: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 66/70

 Are t!ere better ays to read data from a file?Copyr ight  2005 TEMENOS

HEADQUARTERS SJA)

Page 67: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 67/70

CAC>"&"A-

 .sed to read data from t!e cac!e&

 – It c!ec#s if t!e record is in cac!e

 – If yes retrie%es it from t!e cac!e

 – "lse does a (P7 and 7&"A- to fetc! t!e record and loads it in

t!e cac!e – ill not pic# up records from cac!e if t!ey are more t!an

SP7GCAC>"&"PI@G seconds old&Copyr ight  2005 TEMENOS 

HEADQUARTERS SJA1

Page 68: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 68/70

 

 -oesnt 7&"A- also perform a similar operation?

 

!en s!ould I use CAC>"&"A- ?

.se CAC>"&"A- !en – T!e record t!at you retrie%e ill not be frequently updated

 – <est used for retrie%ing parameter records

 – It is faster t!an 7&"A- as it does not require a call to (P7&

W O&y /h#& th# r#(or) i+ &ot "!"i"$# i& ("(h#; it /i p#r*or'"& O7

Copyr ight  2005 TEMENOS 

HEADQUARTERS SJA2

Page 69: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 69/70

CAC>"&"A- 5Cont&6

CAC>"&"A-57ile$ameI-ecord"rror6

7I="$A'" 0 $ame of file it!out t!e mnemonic

5"9ample O 7&C.ST('"6I- 0 Dalid %alues are

I- of a record

SelectI-s 5=ist of Ids from t!e 7ile$ame6

SSelectI-s 5=ist of sorted Ids6

SSelectAs 5=ist of sorted Ids in ascending order rig!t ;ustified6

ecord 0 -ata returned

"rror 0 "C(- $(T 7(.$- for e9ampleCopyr ight  2005 TEMENOS 

HEADQUARTERS SJA*

Page 70: Infobasic Programming

8/18/2019 Infobasic Programming

http://slidepdf.com/reader/full/infobasic-programming 70/70

CAC>"&"A- 5Cont&6

!en  I- is passed to CAC>"&"A-

 –   Ch#( i*  it #.i+t+ i& ("(h# #+# /i r#") *r o' )i+ "&) o")

it to ("(h#

  If SelectI-s is passed to CAC>"&"A-

 – 7#r* or' " (" to EB.READ8-ST. Si&(# th#r# "r# &o

(o&)itio&+ "&) it i+ &ot " +ort#) +##(t; "& i&t#r &"

+##(t#) /i $#

#.#(ut#)

  If SSelectedI- or SSelectAs is passed

 – 7#r* or' " (" to EB.READ8-ST. Si&(# it i+ +ort#) +##(t;/i "(tu"y +##(t th# * i#