Top Banner
AS/400 QUESTION BANK  AS/400 QUESTION BANK 1. Define library? A Library is a collection of o bjects. Ty e !LIB t"at is #se$ to %ro# relate$ object an$ to fin$ o bjects by na&e. A li brary is a $irectory to a %ro# of objects. T"e n#&ber of objects containe$ in a library an$ t"e n#&ber of libraries on t"e syste& are li&ite$ only by t"e a&o#nt of stora%e a'ailable. All libraries are lace$ in t"e syste& library QS(S. Libraries ro'i$e a &et"o$ for or%ani)in% objects. A library is an oen*en$e$ $irectory. A library can ne'er beco&e +,ULL- as if "as no finite si)e. Libraries t"e&sel'es are objects. A library contain t"e object na&e tye an$ t"e a$$ress Library list Syste& library* 1QS(SLIB2 QS(S Q3LS(S QUS5S(S ro$#ct library 67 8#rrent library 6 User library * 7 1QUS5LIB2 Q9L QTE: :(LIB ;"en yo# lo%on t"e first library to be loa$ is QS(S. T"e syste& library is loa$e$ at t"e first ti&e. .Define !b"e#t? E'ery t"in% t"at can be store$ or retrie'e$ on t"e syste& is <no=n as an >OB?E8T@. a%e of
118

as-400 bank

Mar 01, 2018

Download

Documents

ViswanathPv
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 1/118

AS/400 QUESTION BANK 

 

AS/400 QUESTION BANK 

1. Define library?

A Library is a collection of objects.

Tye !LIB t"at is #se$ to %ro# relate$ object an$ to fin$ objects by na&e.

A library is a $irectory to a %ro# of objects.

T"e n#&ber of objects containe$ in a library an$ t"e n#&ber of libraries on

t"e syste& are li&ite$ only by t"e a&o#nt of stora%e a'ailable.

All libraries are lace$ in t"e syste& library QS(S.

Libraries ro'i$e a &et"o$ for or%ani)in% objects.

A library is an oen*en$e$ $irectory.

A library can ne'er beco&e +,ULL- as if "as no finite si)e.

Libraries t"e&sel'es are objects.

A library contain t"e object na&e tye an$ t"e a$$ress

Library list

Syste& library* 1QS(SLIB2

QS(S

Q3LS(S

QUS5S(S

ro$#ct library 67

8#rrent library 6

User library * 7 1QUS5LIB2

Q9L

QTE:

:(LIB

;"en yo# lo%on t"e first library to be loa$ is QS(S. T"e syste& library is

loa$e$ at t"e first ti&e.

.Define !b"e#t?

E'ery t"in% t"at can be store$ or retrie'e$ on t"e syste& is <no=n as an

>OB?E8T@.

a%e of

Page 2: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 2/118

AS/400 QUESTION BANK 

 

Objects eit to &a<e #sers in$een$ent of t"e i&le&entation #se$ in t"e

&ac"ine.

T"e create object instr#ction establis" t"e object-s na&e an$ its tye.

All objects are str#ct#re$ =it" a co&&on object "ea$er an$ a tye

$een$ent f#nctional ortion.

A #ser is not concerne$ =it" t"e sace "is object occ#ies.

T"e syste& allocate sace a#to&atically

;5KOB?C: is #se$ to $islay all object in s#c" a library

 T"e library t"e object na&e an$ its tye is UniD#e.

$.Define s!%r#e &'ysi#al file?

So#rce "ysical file is also a file ="ic" "as one or &ore files incl#$e$ in it. It is

 j#st li<e a $irectory an$ it contains &any &e&bers. T"e &e&bers are li<e a 'ario#s

 ro%ra&s resi$in% in t"e $irectory ()TS)(*+ is #se$ to create so#rce "ysical file.

4. Define &'ysi#al file?

It is a file ="ic" "ysically occ#ies t"e ortion of &e&ory. A "ysical file

contains one recor$ for&at an$ one or &ore &e&bers. It-s tye ,. By #sin% ()T*+

co&&an$ to create ,. :ai&#& n#&ber of fiel$s incl#$e$ in a , is 000. :ai&#& no

of <ey fiel$s incl#$e$ is 70.

 

,. Define l!-i#al file?

Lo%ical file $oes not occ#ies any &e&ory sace an$ lo%ical file be $eri'e$ fro&

 "ysical file. One or &ore lo%ical file can be $eri'e$ fro& a sin%le "ysical file. A lo%ical

file can contain # to 7 recor$ for&ats. It selects recor$s $yna&ically. It cannot eist =it"

o#t a "ysical file. ;e can filter t"e $ata =it" criteria by #sin% sele#t an$ !it co&&an$.

()TL+ co&&an$ is #se$ to create a L,. It accesses t"e $ata by creatin% access at".

  A lo%ical file $oes not contain any $ata b#t ro'i$es t"e +FIE;S- of t"e $ata to

satisfy en$*#ser-s nee$s.

 T"ere are t=o tyes

 Non join lo%ical file

?oin lo%ical file

a%e 7of

Page 3: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 3/118

AS/400 QUESTION BANK 

. Differen#e beteen &'ysi#al file an l!-i#al file?

"ysical file Lo%ical file

. Occ#ies t"e ortion of &e&ory. It-s

containin% $ata.

Coes not occ#y any &e&ory sace. Coes

not contain any $ata.7. A "ysical file contains one recor$

for&at

 A lo%ical file can contain # to 7 recor$

for&ats.

.8an be eist e'en =it" o#t L, 8an not eist =it" o#t ,

4. If yo# $elete a L, t"e , can not be

$elete$

If yo# $elete a L, t"e , can not be $elete$

.()T*+ co&&an$ is #se$ to create s#c"

object

()TL+  co&&an$ is #se$ to create s#c"

tye object

G.T"e object tye is , T"e object tye is L,

 

2. 3'at are t'e f!%r leels !f entries in &'ysi#al file?

5i6. +ile leel entries 5!&ti!nal6H ,ile le'el entries %i'e t"e syste& infor&ation

of t"e entire file. 1UNIQUE LI,O ,I,O ,8,O 5E,2

UNIQUEH A recor$ cannot be entere$ or coie$ into a file if its <ey 'al#e is

sa&e as t"e <ey 'al#e of a recor$ alrea$y eistin% in t"e file.

LI,OH Last in first o#t

,I,OH ,irst in first o#t

,8,OH ,irst c"an%e first o#t.

5E,H T"is <ey=or$ is #se$ to secify t"e na&e of t"e file fro& ="ic" t"e

fiel$ $escritions are retrie'e$.

E7H yo# can secify ="et"er t"e <ey is #niD#e.

5ii6. )e#!r f!rat leel entriesH 5ecor$ for&at le'el entries %i'e t"e syste&

infor&ation abo#t secific recor$ for&at in t"e file. ,or a *+ t"e recor$

for&at na&e is secifie$ alon% =it" an otional tet $escrition. 1,O5:ATTET2

5i6 +O)8ATH

T"is recor$*le'el <ey=or$ secifies t"at t"e recor$ for&at bein% $efine is to

s"are t"e fiel$ secifications of a re'io#sly $efine$ recor$ for&at. T"e

a%e of

Page 4: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 4/118

AS/400 QUESTION BANK 

na&e of t"e recor$ for&at bein% $efine$ &#st be t"e na&e of t"e re'io#sly

$efine$ recor$ for&at.

 T'e f!rat !f t'is 9ey!r is:

  ,O5:AT 1LIB*NA:E / ,ILE*NA:E2

5ii6 TE;T:

T"is recor$ le'el <ey=or$ is #se$ to s#ly a tet $escrition of t"e recor$

for&at an$ it is #se$ for $oc#&entation #roses only.

T'e f!rat !f t'is 9ey!r is:

  TET 1+$escrition-2

5iii6 +iel leel entries: T"e fiel$ na&es an$ fiel$ len%t"s are secifie$ alon%

=it" an$ otional tet $escrition for eac" fiel$. 1ALIAS AL;NULL

88SIC 83E8K 83K:S9IC 8: 8OL3C9 8O: CAT,:T

CATSE C,T ECT8CE ECT;5C 5E,,LC 5E,S3I,T TET

TI:E,:T TI:ESE FALUES FA5LEN2

5i6 Key fiel leel entriesH T"e fiel$ na&es #se$ as <ey fiel$s are secifie$.

1CES8ENC SI9NEC ABSFAL UNSI9NEC JONE NOALTSEQ

CI9IT2

<. 3'at are t'e si7 leels !f entries in l!-i#al file?

5i6 +ile leel entries 5!&ti!nal2H ,ile le'el entries %i'e t"e syste& infor&ation

of t"e entire file. (o# can secify ="et"er t"e <ey is sa&e as "ysical file.

5ii6 )e#!r f!rat leel entriesH 5ecor$ for&at le'el entries %i'e t"e syste&

infor&ation abo#t secific recor$ for&at in t"e file. ,or ea&les for a

lo%ical file ="en a recor$ for&at is $escribe$ =e can secify t"e "ysical

file it is base$ on.

5iii6 =OIN Leel entries: ?oin le'el entries %i'e t"e syste& infor&ation abo#t

*+ #se$ in a ?OIN LO9I8AL ,ILE. 1It is not alicable to NON ?OIN

LO9I8AL ,ILES2.

5i6 +iel leel entries  1!&ti!nal6: T"e fiel$ le'el entries %i'e t"e syste&

infor&ation abo#t in$i'i$#al fiel$s in t"e recor$ for&at.

56 Key fiel leel entries: T"e <ey fiel$ le'el entries %i'e t"e syste&

infor&ation abo#t t"e <ey fiel$s of a file. T"e fiel$ na&es #se$ as <ey fiel$s

are secifie$.

a%e 4of

Page 5: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 5/118

AS/400 QUESTION BANK 

5i6 Sele#t / Oit leel entries: T"ese entire %i'e t"e syste& infor&ation abo#t

="ic" recor$s are to be ret#rne$ to t"e ro%ra& ="en rocessin% t"e file.

T"ese secifications aly to lo%ical file only.

>. E7&lain =DU*SEQ an =D+TAL.

=DU*SEQ:

T"is join 6le'el <ey=or$ is #se$ to secify t"e or$er in ="ic" recor$s =it"

$#licate join fiel$s are resente$ ="en t"e ?L, is rea$.

T'e f!rat f!r t'is 9ey!r is:

?CUSEQ 1SeD#encin% fiel$*na&e !CES8ENC2

T"is <ey=or$ "as no effect on t"e or$erin% of recor$s =it" #niD#e <eys.

If !CES8ENC is not secifie$ t"en t"e $efa#lt is seD#encin% in ascen$in%

or$er.

=D+TAL:

;"en t"is file*le'el <ey=or$ is #se$ t"e syste& ro'i$es $efa#lt 'al#es for 

all for fiel$s ="en a join to a secon$ary file $oes not ro$#ce any recor$s.

If t"is <ey=or$ is not secifie$ a recor$ in t"e ri&ary file for ="ic" t"ere is

no correson$in% recor$ in t"e secon$ary file is s<ie$.

10. 3'at are t'e ifferent beteen n!n@"!in l!-i#al files an "!in l!-i#al files.

 Non join lo%ical file ?oin lo%ical file

;e can able to insert or $elete or #$ate

recor$s #sin% non*lo%ical file.

Insertion #$atin% or $eletion of recor$s is

not ossible in join lo%ical files.

C,U can be #se$ to $islay non*join

lo%ical file.

C,U is not a'ailable

*7 recor$ for&at is secifie$ Only one recor$ for&at can be secifie$

8o&&it&ent control is #se$ 8o&&it&ent control cannot be #se$.

11. ! any re#!r f!rats #an 'ae &'ysi#al l!-i#al file.

T"e "ysical file only one recor$ for&at can be secifie$.

T"e lo%ical file *7 recor$ for&at is secifie$

1. 3'at is t'e aanta-e !&en C%ery file?

a%e of

Page 6: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 6/118

AS/400 QUESTION BANK 

Cyna&ic selection of recor$s

It =ill sort t"e recor$s base$ on t"e fiel$ 'al#es.

;e can retrie'e recor$s base$ on Firt#al fiel$s.

8an create join lo%ical files

1$. E7&lain n!n@"!in l!-i#al file?

 Non*join lo%ical files can eit"er be a si&le lo%ical file ="ic" contains only one

recor$ for&at or a &#ltile recor$ for&at lo%ical file ="ic" contains &ore t"an one

5ecor$ for&at.

Lo%ical files can be $eri'e$ fro& to 7 "ysical files an$ so a lo%ical file can "a'e

a &ai&#& of 7 recor$ for&ats.

Sin-le re#!r f!rat l!-i#al file:

If a lo%ical file is $eri'e$ fro& sin%le "ysical file it is calle$ si&le lo%ical file.

8%lti&le re#!r f!rat l!-i#al file:

:#ltile recor$ non*join lo%ical files =ill select recor$s fro& 7 or &ore "ysical

files by referrin% to only one lo%ical file.

Eac" recor$ for&at is al=ays associate$ =it" one or &ore "ysical file.

T"e sa&e , can be #se$ in &ore t"an one recor$ for&at.

S&e#ify t'e entries in sin-le !r %lti&le f!rat l!-i#al files:

1. File-level entries (optional)H 15E,A88T3 C(NSLT2

5E,A88T3H T"e access at" infor&ation for t"is lo%ical file is to be

coie$ fro& anot"er , or L,.

+!rat !f t'e 9ey!r is:

5E,A88T3 1LIB na&e / CATABASE na&e2

C(NSLTH T"is <ey=or$ is selection an$ o&ission tests in t"e file. T"is

<ey=or$ secifies $yna&ic select/o&it.

2.Record – level entriesH1,ILE2,ILEH T"e "ysical files containin% t"e $ata to be accesse$ t"ro#%" t"e

 5ecor$ for&ats bein% $efine$.

+!rat !f t'e 9ey!r is:

,ILE 1LIB na&e / , na&e2

3.Field-level entries (optional)

a%e Gof

Page 7: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 7/118

AS/400 QUESTION BANK 

4. Key field –level entries (optional)

5.Select and Oit –field level entries (optional)

5E,A88T3MIt is alicable for non*join lo%ical file only an$ &eanin% is

referrin% t"e access at" fro& t"e , or L, in t"e file 6 le'el entries.

,ILE*** it is alicable only for non*join lo%ical file in recor$ le'el entries.

14. E7&lain "!in l!-i#al file?

A join*lo%ical file is a lo%ical file t"at co&bines t=o or &ore ,. In t"e recor$

for&at not all t"e fiel$s nee$ to eist in all t"e ,.

A , cannot be c"an%e$ t"ro#%" a ?L,.

C,U cannot be #se$ to $islay a ?L,.

Only one recor$ for&at can be secifie$ in a ?L,.

8o&&it&ent control cannot be #se$ =it" a ?L,.

Key fiel$s &#st be fiel$s $efine$ in t"e join recor$ for&at an$ &#st be

fiel$s fro& t"e 5I:A5( ,ILE.

S&e#ify t'e entries in "!in l!-i#al file:

. ,ile*le'el entries 1otional2H 1?C,TFAL2

7.5ecor$*le'el entriesH 1?,ILE2

.join*le'el entries H1?OIN ?,LC ?CUSEQ2

4.fiel$ 6le'el entries 1otional2H 1?5E, ALL 8ON8AT C(NSLT5ENA:E SST T5NTBL2

.Key fiel$ 6le'el entries 1otional2

G.Select an$ O&it fiel$ le'el entries. 1Otional2

?,ILE****It is si&ilar to in$icate t"at t"is is a join lo%ical fiel$

an$ it &#st "a'e &ore t"an 7 "ysical files.

?OINH It is si&ilar t"at t"is file le'el entries to be reresent t"e

 osition of t"e files .T"ere &#st one ri&ary file an$ can "a'e

&ore t"an I secon$ary files..

?,LCH ;"ic" feels =e are %oin% to join.

?5E,H reresents t"e ri&ary file reference fiel$

?C,TFALH reresents t"at it as a left o#ter join.

a%e of

Page 8: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 8/118

AS/400 QUESTION BANK 

SELE(T O8IT

8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP SELO:IT

 ,:T ,.

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!

000.00 5 5E8SEL0007.00 E:NO 0

000.00 E:NA:E 70A

0004.00 K E:NO  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!

  E8*NO E8*NA8E

 00000 000 S3(A: 000007 0007 SANKA

 00000 000 S3(A:

 000004 0004 SENT3

 00000 000 SANKA

 00000G 000G S3(A: 00000 000 SANKA

 00000 000 SENT3 00000 000 S3(A:

 00000 000 SENT3

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP SELO:IL,

 ,:T L,...  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!

000.00 5 5E8SEL ,ILE 1SELO:IT2

0007.00 K E:NO000.00 S E:NO 8: 19T 00020004.00 O E:NA:E 8: 1EQ RS3(A:R2

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!

  Cislay 5eort

  E8*NO E8*NA8E

 00000 0007 SANKA

 000007 0004 SENT3 00000 000 SANKA

 000004 000G S3(A:

 00000 000 SANKA

 00000G 000 SENT3 00000 000 S3(A:

 00000 000 SENT3

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP SELO:IL,

 ,:T L,!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 5E8SEL ,ILE 1SELO:IT2

0007.00 K E:NO

a%e of

Page 9: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 9/118

AS/400 QUESTION BANK 

000.00 O E:NA:E 8: 1EQ RS3(A:R20004.00 S E:NO 8: 19T 0002

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!

 

E8*NO E8*NA8E

 00000 0007 SANKA

 000007 0004 SENT3 00000 000 SANKA

 000004 000 SANKA

 00000 000 SENT3 00000G 000 SENT3

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP SELO:IT

 ,:T ,.

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!000.00 5 5E8SEL

0007.00 E:NO 0000.00 E:NA:E 70A0004.00 K E:NO

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!

  E8*NO E8*NA8E

 00000 70 S3(A:

 000007 0 5A:

 00000 40 TO: 000004 0 5A:ES3

 00000 G0 S3(A:

 00000G 0 S3(A:

 00000 0 TO: 00000 0 TO:

 00000 00 FASU

 !!!!!! !!!!!!!! En$ of reort !!!!!!!! 

8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP SELO:IL,

 ,:T L,!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 5E8SEL ,ILE 1SELO:IT20007.00 K E:NO

000.00 S E:NO 8: 19T 02

0004.00 S E:NA:E FALUES 1RS3(A:R2

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!

a%e of

Page 10: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 10/118

AS/400 QUESTION BANK 

 E8*NO E8*NA8E

 00000 70 S3(A:

 000007 G0 S3(A:

 00000 0 S3(A: 000004 0 TO:

 00000 0 TO:

 00000G 00 FASU !!!!!! !!!!!!!! En$ of reort !!!!!!!!

8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP SELO:IL,

 ,:T L,.

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 5E8SEL ,ILE 1SELO:IT20007.00 K E:NO

000.00 S E:NO 8: 19T 02

0004.00 O E:NO 5AN9E 170 402  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!

 

E8*NO E8*NA8E

 00000 0 5A:ES3

 000007 G0 S3(A: 00000 0 S3(A:

 000004 0 TO:

 00000 0 TO: 00000G 00 FASU

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP SELO:IL, ,:T L,

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!

000.00 5 5E8SEL ,ILE 1SELO:IT20007.00 K E:NO

000.00 S E:NO 8: 19T 02

0004.00 S E:NA:E FALUES 1RS3(A:R2

000.00 O E:NO 5AN9E 10 02  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!

  E8*NO E8*NA8E

 00000 70 S3(A:

 000007 0 5A:

 00000 40 TO:

 000004 0 5A:ES3 00000 G0 S3(A:

 00000G 0 S3(A:

a%e 0of

Page 11: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 11/118

AS/400 QUESTION BANK 

 00000 0 TO: 00000 0 TO:

 00000 00 FASU

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP SELO:IL,

 ,:T L,  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!

000.00 5 5E8SEL ,ILE 1SELO:IT2

0007.00 K E:NO000.00 S E:NO 8: 19T 02

000.00 O E:NO 5AN9E 10 02

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!

  E8*NO E8*NA8E

 00000 70 S3(A:

 000007 0 5A: 00000 40 TO:

 000004 0 5A:ES3 00000 G0 S3(A: 00000G 0 S3(A:

 00000 0 TO:

 00000 0 TO:

 00000 00 FASU !!!!!! !!!!!!!! En$ of reort !!!!!!!!

1,. E7&lain self "!in?

?oinin% a file to it self is <no=n as self*join.

  1Or2

A "ysical file can be joine$ to itself to rea$ recor$s t"at are for&e$ by co&binin%

t=o or &ore recor$s fro& t"e , itself.

8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP SE?OIN ,:T ,

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!

000.00 5 E:

0007.00 E:IC 0000.00 E:NA:E 70A

0004.00 :95IC 0

000.00 K E:IC  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!

E8*ID E8*NA8E 8)ID

 00000 000 SEBI ?OSE3 8. 000

 000007 0007 U5US3OTTA: 0007

 00000 000 SA:EE5 CI93E 000

a%e of

Page 12: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 12/118

AS/400 QUESTION BANK 

 000004 0004 S3A5ATA 0004 00000 000 AUL 000

 00000G 000 S3IFA5A: 000

 00000 0007 9AU5AF 0007 00000 000 KIN9 000

 00000 0004 SA: 0004

 00000 000 ANIL 000 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP SEL?OIN ,:T L,

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 E: =+ILE 5SE=OIN SE=OIN6

0007.00 ? ?OIN 1 72000.00 ?,LC 1:95IC E:IC2

0004.00 E:IC ?5E, 12

000.00 E:NA:E ?5E, 12000G.00 :ANA9E5 5ENA:E 1E:NA:E2 ?5E, 172

000.00 8OL3C9 1R:ANA9E5R2  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  E8*ID E8*NA8E 8ANAE) 

 00000 000 SEBI ?OSE3 8. S3IFA5A:

 000007 0007 U5US3OTTA: 9AU5AF 00000 000 SA:EE5 CI93E KIN9

 000004 0004 S3A5ATA SA:

 00000 000 AUL ANIL !!!!!! !!!!!!!! En$ of reort !!!!!!!!

8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP SEL?OIN

 ,:T L,

!!!!!!!!!!!!!!! Be%innin% of $ata!!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 E: ?,ILE 1SE?OIN SE?OIN20007.00 ? ?OIN 1 72

000.00 ?,LC 1:95IC E:IC2

0004.00 E:IC ?5E, 12000.00 E:NA:E 5ENA:E 1E:NA:E2

000G.00 ?5E, 12

000.00 :95IC ?5E, 172

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!! 

E8*ID E8*NA8E 8)ID

00000 000 SEBI ?OSE3 8. 000

000007 0007 U5US3OTTA: 0007

00000 000 SA:EE5 CI93E 000

000004 0004 S3A5ATA 000400000 000 AUL 000

!!!!!! !!!!!!!! En$ of reort !!!!!!!!

a%e 7of

Page 13: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 13/118

AS/400 QUESTION BANK 

8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP SEL?OIN

 ,:T L,

!!!!!!!!!!!!!!! Be%innin% of $ata!!!!!!!!!!!!!!!!!!!!!!!!000.00 5 E: ?,ILE 1SE?OIN SE?OIN2

0007.00 ? ?OIN 1 72

000.00 ?,LC 1:95IC E:IC20004.00 E:IC ?5E, 12

000.00 :ANA9E5 5ENA:E 1E:NA:E2

000G.00 ?5E, 172 8OL3C9 1R:ANA9E5R2000.00 :95IC ?5E, 172

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!

  E8*ID 8ANAE) 8)ID

 00000 000 S3IFA5A: 000 000007 0007 9AU5AF 0007

 00000 000 KIN9 000

 000004 0004 SA: 0004 00000 000 ANIL 000

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

1. E7&lain n!raliati!n?

It is t"e rocess of se%re%atin% an$ $eco&osin% infor&ation "el$ =it"in a syste&

into lo%ically %ro#e$ relate$. UniD#ely i$entifiable entities

12. ! t! #reate %ser efine #!an?

By #sin% t"e 85T8:C co&&an$ rocess t"e co&&an$ $efinition state&ents to

create t"e co&&an$ $efinition object. T"e 85T8:C co&&an$ &ay be r#n interacti'ely or in a batc" job.

Stes for creatin% 85T8:C co&&an$s

. Enter t"e co&&an$ $efinition state&ents into t"e so#rce file

 8o&&an$ tye 8:C

SKANCASA:O/8L

8:C

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 8:C

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

7. Enter so#rce ro%ra& in any lan%#a%e

SKANCASA:O/8L

CLIB

a%e of

Page 14: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 14/118

AS/400 QUESTION BANK 

T(E H8L

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 9:

0007.00 CSLIBL

000.00 ENC9:

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

. 8reate t"e co&&an$ by #sin% 85T8:C ta<e f4

8o&&an$ . . . . . . . . . . . . P KS  Na&e

  Library . . . . . . . . . . . P SKANDASA8O Na&e !8U5LIB

 ro%ra& to rocess co&&an$ . . . P DLIB  Na&e !5E

  Library . . . . . . . . . . . P SKANDASA8O Na&e !LIBL !8U5LIB

  So#rce file . . . . . . . . . . P (L*  Na&e

  Library . . . . . . . . . . . P SKANDASA8O Na&e !LIBL !8U5LIB

So#rce &e&ber . . . . . . . . . P (8D1  Na&e !8:C

  T"rea$ safe . . . . . . . . . . . !NO !(ES !NO !8ONC

  :#ltit"rea$e$ job action . . . . !S(SFAL !S(SFAL !5UN !:S9

!NO5UN

  Tet R$escritionR . . . . . . . !S58:B5TT

1<. ! ! #!&y a re#!r in e7istin- !b"e#t t! an!t'er !b"e#t?

By #sin% 8(, co&&an$ if yo# =ant to coy a $ata one osition to anot"er 

 osition. ;e 8an %i'e t"e recor$s coyin% osition startin% an$ en$in% of t"e recor$s. ;e

=ant artic#lar recor$s &eans. ;e can %i'e t"e co&&an$ in sD osition.

8(, ta<e ,4

,ile na&e 1so#rce file2 H ,0

Lib*na&e H SKANCASA:O

 Ne= file na&e H ,07

Lib*na&e H SKANCASA:O

  H!,I5ST

5elace H!ACC

  H!NO

a%e 4of

Page 15: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 15/118

AS/400 QUESTION BANK 

  H!83A5 

  Start osition H 000

En$ osition H 7000

SDl co&&an$ H

,ILEC E:NO

8ONCITION !9T

FALUE 40

5ecor$ for&at &ain% H!:A1a$$ fiel$2

C5O 1$elete fiel$2

1>. E7&lain t'e #!an ADD*+(ST?

ACC,8ST is a co&&an$ t"at is #se$ to $efine t"e 8onstraint on yo#r "ysical

file. T"e constraint "as se'eral tyes. T"ese are 5E,8ST UNQ8ST an$ 5IKE(. By t"e by t"is co&&an$ is "els to $efine U$ate r#les an$ Celete r#les.

0. ! ill be establis'in- )E+E)ENTIAL INTETITF in as/400 syste?

By #sin% ACC,8ST co&&an$ establis" in as/400 syste&.

5eferential inte%rity concets

5eferential constraint

arent an$ $een$ent files

UniD#e <ey an$ ri&ary <eys

arent an$ forei%n <eys

Celete r#le

roa%ate $elete fro& arent file to $een$ent file

  5estrict $elete on arent file

U$ate r#le

5estrict inconsistent #$ates

Insert oerations on $een$ent file are c"ec<e$

5eferential constraint

A referential constraint is a relation bet=een t=o files t"e arent file an$

t"e $een$ent file.

T"is relations"i establis"es t"at e'ery recor$ in t"e $een$ent file "as

to "a'e a &atc"in% recor$ in t"e arent file.

a%e of

Page 16: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 16/118

AS/400 QUESTION BANK 

T"e <ey 'al#e of any recor$ in t"e $een$ent file &#st &atc" a <ey

'al#e in t"e arent file.

;e call arent <ey t"e <ey of t"e arent file an$ forei%n <ey t"e <ey in

t"e $een$ent file.

T"e arent <ey "as to be #niD#e an$ cannot contain n#ll 'al#es.

T"e forei%n <ey 'al#e "as to &atc" one 1any only one2 'al#e of t"e

 arent <ey. Ot"er=ise t"e forei%n <ey can contain a n#ll 'al#e.

A recor$ in t"e arent file &ay be relate$ to &#ltile recor$s in t"e

$een$ent files eac" recor$ in t"e $een$ent file "as to "a'e j#st one@

 arent@ or "a'e a n#ll forei%n <ey.

ri&ary <ey =e &eans a #niD#e an$ ascen$in% <ey ="ic" is t"e

 ri&ary access at" for a , an$ cannot contain n#ll 'al#es.

ri&ary access at" for a $atabase file on t"e AS/400 in t"e access at"

#se$ to access t"e file by #sin% ONCB, co&&an$.

Celete r#le

;e can $elete a recor$ fro& arent file or $een$ent file first c"ec< for 

$elete r#le.

8AS8ACEH If =e =ant to $elete a recor$ fro& t"e arent file an$ its

 arent <ey is &atc"in% recor$s in a $een$ent file t"e CB:S =ill $elete

all t"e &atc"in% recor$s of t"e $een$ent file.

SETNULLH If =e $elete a recor$ fro& t"e arent file an$ arent <ey is

&atc"in% so&e recor$s in a $een$ent file t"e CB:S =ill set to n#ll t"e

&atc"in% <eys in t"e $een$ent file.

SETCE,AULTH T"is is li<e re'io#s case b#t &atc"in% occ#rrences in

t"e forei%n <ey are set to t"eir $efa#lt 'al#es. T"e $efa#lt 'al#e for t"e

forei%n <ey "as to &atc" a recor$ in t"e arent file. 5EST5I8TH T"e CB:S =ill re'ent any atte&t to $elete recor$s in t"e

 arent file if its <ey is &atc"in% so&e recor$s in t"e $een$ent file.

 NO A8TIONH T"is "as t"e sa&e &eanin% as restrict b#t $ifferent

ti&in%. ;"en =e #se !NOA8TION an$ an in'ali$ $elete oeration is

abo#t to ta<e lace CB7 /400 =ill $elay any error &essa%e #ntil t"e en$

a%e Gof

Page 17: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 17/118

AS/400 QUESTION BANK 

of t"e oeration itself allo=in% for instance t"e acti'ation of a before

tri%%er attac"e$ to t"e ,.

If !restrict is in #se t"e ecetion &essa%e is sent i&&e$iately.

Celetin% recor$s in a $een$ent file is al=ays er&itte$.

U$ate r#le 5EST5I8TH ;e cannot c"an%e t"e 'al#e in a arent <ey if t"e ol$ 'al#es

are &atc"in% so&e recor$s in t"e $een$ent file.

 T"e re&ainin% ortion of t"e recor$ can al=ays be #$ate$.

;e cannot #$ate a forei%n <ey in a $een$ent file if t"e ne=

'al#e for t"e <ey is not n#ll an$ $oes not &atc" any 'al#e of t"e

 arent <ey.

  NO A8TIONH T"is is sa&e as ! restrict b#t =it" $ifferent ti&in%

consi$erations. 5efer abo'e ="ere =e $escribe no action $elete

oerations.

Inserts

T"ere is no insert r#le to be c"osen b#t referential inte%rity re'ents any

insert in t"e $een$ent file if t"e ne= recor$ "as no &atc" in t"e arent

file an$ its forei%n <ey is not n#ll.

1. ! t! #reate a tri--er in AS/400?

T"e tri%%er is an e'ent to be erfor&in% before or after any c"an%e to a $atabase.

;"en a tri%%er is a$$e$ to a "ysical file t"ree attrib#tes nee$ to be $efine$.

T"e first is t"e e'ent t"at =ill ca#se t"e tri%%er to fire. A tri%%er e'ent

can be an insert an #$ate or a $elete a recor$ fro& t"e file.

T"e secon$ attrib#te to $efine is ="en to fire t"e tri%%er*before or after 

t"e e'ent.

T"e t"ir$ attrib#te to $efine is t"e i$entification of t"e tri%%er ro%ra& to

 by r#n.

  ;e can infer t"at # to si tri%%ers can be $efine$ for eac" ,.

,or eac" #$ate insert an$ $elete

T=o tri%%ers can be $efine$

One t"at r#ns before t"e e'ent

a%e of

Page 18: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 18/118

AS/400 QUESTION BANK 

One t"at r#ns after t"e e'ent

T"ese tri%%er are a$$e$ #sin% t"e ACC,T59

8an be re&o'e$ =it" t"e re&o'e , tri%%er co&&an$ 15:F,T592

T"e co&&an$ ACC,T59 ta<es ,4

, ,00

LIB SKANCASA:O

T5I99E5 TI:E !A,TE5 !BE,O5E !A,TE5  

T5I99E5 EFEFT !UCATE !UCATE !INSE5T

!CELETE

5O95A: 9:00 NA:E

LIB SKANCASA:O

5ELA8E T5I99E5 !NO !NO !(ES

ALLO; 5EEATEC !NO !NO !(ES

. 3'at is t'e ata area?

A $ata area is an object #se$ to store $ata for access by any job r#nnin% on t"e

syste&. It is er&anent stora%e. A $ata area can be #se$ ="ene'er yo# nee$ to store

infor&ation of li&ite$ si)e in$een$ent of t"e eistence of t"e ro%ra&s or files.

Tyical #ses of $ata areas areH

To ro'i$e an area to ass infor&ation =it"in job.

To ro'i$e a fiel$ t"at is easily an$ freD#ently c"an%e$ to control

references =it"in a job s#c" as s#lyin% t"e net c"ec< n#&ber.

To ro'i$e a constant fiel$ for #se in se'eral jobs s#c" as ta

rate

To ro'i$e li&ite$ access to a lar%e rocess t"at reD#ires t"e $ata

area.

A $ata area can be loc<e$ to a sin%le #ser t"#s re'entin% ot"er 

#sers fro& rocessin% at t"e sa&e ti&e.

To create a %eneral $ata area #se t"e co&&an$ 185TCTAA5A2

To retrie'e 'al#es fro& $ata area #se 15TFCTAA5A2

a%e of

Page 19: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 19/118

AS/400 QUESTION BANK 

To c"an%e t"is 'al#e #se 1839CTAA5A2

To $islay t"e c#rrent 'al#e #se 1CSCTAA5A2

To $elete a $ata area #se 1CLTCTAA5A2

Tye of $ata area create$ by t"e syste&

Local $ata area

9ro# $ata area

ro%ra& initiali)ation ara&eter 1I2 $ata area

SKANCASA:O/59ILE

 CA5EA

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 CS S 0A

0007.00 C9 S 0A INJ 1RI 3ATE (OUR2000.00 8 !CTAA5A CE,INE CATA S

0004.00 8 !LO8K IN S

000.00 8 EFAL S9

000G.00 8 OUT S

000.00 8 S CSL(

000.00 8 SETON L5 

!!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( I 3ATE (OU

AUTO NU8BE) ENE)ATION

  SKANCASA:S/TEST

 TESTE

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 CA S 4S 0

0007.00 8 !CTAA5A CE,INE CATA7 A

000.00 8 !LO8K IN A

0004.00 8 EFAL AA

000.00 8 OUT A

000G.00 8 A CSL(

a%e of

Page 20: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 20/118

AS/400 QUESTION BANK 

000.00 8 SETON L5 

000.00 8

000.00 8

000.00 8

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL(

CSL( G

$.Define LDAG DAG an *I*?

LO8AL CATA A5EA 1LCA2

A local $ata area is create$ for eac" job in t"e syste& a#to&atically

="en yo# s#b&it a job.

Only one LCA can be create$ by s#b&ittin% a job.

T"e syste& create a local $ata area ="ic" is initially fille$ =it" blan<s

=it" a len%t" of 074 an$ tye H(A).

;"en yo# s#b&it a job #sin% SB:?OB co&&an$ t"e 'al#e of t"e

s#b&ittin% job-s local $ata area is coie$ into t"e s#b&itte$ job-s local

$ata area.

(o# can refer to yo#r job-s local $ata area by secifyin% !LCA for t"eCTAA5A <ey=or$ on t"e 839CTAA5A 5TFCTAA5A an$

CSCTAA5A co&&an$s or !LCA for t"e s#b strin% b#ilt*in f#nction

1SST2

T"e follo=in% is tr#e of a local $ata areaH

T"e local $ata area cannot be referre$ to fro& any ot"er job.

(o# cannot create $elete or allocate a local $ata area.

;e can to c"an%e t"e contents of LCA by t"e by #sin%839CTAA5A co&&an$.

 No library is associate$ =it" t"e local $ata area.

A88ESSIN9 LCAH

839FA5 FA5 1SST 1!LCA 22 FALUE172

O5 

a%e 70of

Page 21: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 21/118

AS/400 QUESTION BANK 

839CTAA5A CTAA5A 1!LCA 1 22 FALUE172

839FA5 FA5 1V5OLNO2 FALUE 1SST 1!LCA 22

O5 

5TFCTAA5A CTAA5A 1!LCA 1 22 5TNFA5 1V5OLNO2

95OU CATA A5EA 19CA2

T"e syste& creates a %ro# $ata area ="en an interacti'e job beco&es a

%ro# job.

Only one %ro# $ata area can eist for a %ro#.

T"e %ro# $ata area is $elete$ ="en t"e last job in t"e %ro# is en$e$ or 

="en t"e job is no lon%er art of t"e %ro# job.

A %ro# $ata area ="ic" is initially fille$ =it" blan<s "as a len%t" of 

7 an$ tye !83A5.

T"e follo=in% is tr#e for a %ro# $ata area

(o# cannot #se t"e %ro# $ata area as a s#bstit#te for a c"aracter 

'ariable on t"e s#b strin% b#ilt*in f#nction.

A %ro# $ata area cannot be referre$ by jobs o#tsi$e t"e %ro#.

(o# cannot create $elete or allocate a %ro# $ata area

 No library is associate$ =it" a %ro# $ata area.

Ea&le

839CTAA5A CTAA5A 1!9CA2 FALUE 1+CE8E:BE5 G-2

5TFCTAA5A CTAA5A 1!9CA2 5TNFA5 1V95A5A2

5O95A: INITIALIJATION A5A:ETE5 5*I*2 CATA A5EA

A I $ata area is create$ for eac" re*starte$ job ="en t"e job is

starte$.

T"e object s#b*tye of t"e CA is $ifferent t"en a re%#lar $ata area.

T"e I can only be referre$ to by t"e secial 'al#e na&e !CA.

T"e si)e of t"e CA is 7000 bytes b#t t"e n#&ber of ara&eter 

containe$ in it is not restricte$.

4. 3'at are ari!%s ste&s a##essin- ata area in (L?

T"e first create a %eneral $ata area #se t"e co&&an$ 185TCTAA5A2

a%e 7of

Page 22: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 22/118

AS/400 QUESTION BANK 

To retrie'e 'al#es fro& $ata area #se 15TFCTAA5A2

To c"an%e t"is 'al#e #se 1839CTAA5A2

To $islay t"e c#rrent 'al#e #se 1CSCTAA5A2

To $elete a $ata area #se 1CLTCTAA5A2

,. ari!%s ty&es !f essa-e aailable in (L?

:essa%e is t"e interface bet=een oeratin% syste& an$ t"e ro%ra&s or #ser an$

 ro%ra&. ;e can classify t"e &essa%e into t=o tyes na&ely

I&&e$iate &essa%e

re$efine$ &essa%e

Ieiate essa-e

;"ic" $oes t"e ro%ra& or syste& #ser create ="en t"ey are sent an$ are

not er&anently store$ in t"e syste&W

8ontrol lan%#a%e

SNCUS5:S9

SNC9::S9

SNC:S9

SNCB5K:S9

Cislay files

E55:S9

S,L:S9

INQUI5( an$ IN,O5:ATIONAL &essa%eH

Usin% SNCUS5:S9 co&&an$ to sen$ tye of &essa%e

*reefine essa-e

;"ic" are create$ before t"ey are #se$. T"ese &essa%es are lace$ in a

&essa%e file 1D#e#e2 ="en t"ey are create$ an$ retrie'e$ fro& t"e file ="en

t"ey are #se$.

8ontrol lan%#a%e

SNCUS5:S9

SNC9::S9

a%e 77of

Page 23: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 23/118

AS/400 QUESTION BANK 

5TF:S9

Cislay files

E55:S9IC

S,L:S9IC

:S98ON

:S9IC

8O:LETION an$ CIA9NOSTI8 &essa%e

Usin% SNC9::S9 co&&an$ t"ese of &essa%e can be sent to

any &essa%e D#e#e.

CIA9NOSTI8 &essa%e tell t"e callin% ro%ra& abo#t errors

$etecte$ by t"e ro%ra&. 8o&letion &essa%e tell t"e res#lt of 

=or< $one by t"e ro%ra&.

STATUS &essa%es

Usin% SNC9::S9 co&&an$ stat#s &essa%e can be sent to it-s

caller-s ro%ra& &essa%e D#e#e or to t"e eternal &essa%e D#e#e for t"e

 job. T"ese &essa%e tell t"e recei'in% ro%ra& t"e stat#s of t"e =or< 

 erfor&e$ by t"e sen$in% ro%ra&.

ES8AE &essa%e

Usin% SNC9::S9 co&&an$ escae &essa%e fro& a 8L ro%ra&

can be sent to it-s callin% ro%ra&. An escae &essa%e tells t"e callin%

 ro%ra& en$e$ abnor&ally an$ ="y.

 NOTT,( &essa%e

 Notify &essa%e fro& a 8L ro%ra& can be sent to t"e &essa%e D#e#e

of callin% ro%ra& or to t"e eternal &essa%e D#e#e. A notify &essa%e tells

t"e callin% ro%ra& abo#t a con$ition #n$er ="ic" rocessin% can contin#e.

re$efine$ &essa%e are store$ in &essa%e file

To create a &essa%e file

85T:S9, :S9, 1:,ILE2 SIJE 12 AUT 12 TET 12

8reate an$ &aintain &essa%es

ACC:S9C

a%e 7of

Page 24: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 24/118

AS/400 QUESTION BANK 

839:S9C O5 ;5K:S9C

CS:S9C

5:F:S9C

:essa%e file Q8,:S9 in library QS(S contain t"e syste& &essa%e

. 3'at ill 8ON8S #!an in !?

T"e &onitor &essa%e 1:ON:S92 co&&an$ &onitors t"e &essa%e sen$ to t"e

 ro%ra& &essa%e D#e#e for t"e con$itions secifie$ in t"e co&&an$. If con$ition eists

t"e 8L co&&an$ secifie$ on t"e :ON:S9 co&&an$ is r#n.

Tyes of &onitor &essa%e

Escae :essa%e

Stat#s or Notify :essa%e

Escae :essa%e

Escae &essa%e are sen$ to tell yo#r ro%ra& of an error con$ition t"at

force$ t"e sen$er to en$. By &onitorin% for escae &essa%e yo# can ta<e correcti'e

actions or clean # an$ en$ yo#r ro%ra&.

Stat#s or Notify :essa%e

Stat#s an$ notify &essa%e are sen$ to tell yo#r ro%ra& of an abnor&al

con$ition t"at is not serio#s eno#%" for sen$er to en$. By &onitorin% for stat#s

or notify &essa%e yo#r ro%ra& can $etect t"is con$ition an$ not allo= t"e

f#nction to contin#e.

T=o le'els of :ON:S9 co&&an$

ro%ra& le'el

Secific co&&an$ le'el

ro%ra& le'el

T"e :ON:S9 is secifie$ i&&e$iately follo=in% t"e last $eclaresco&&an$ in yo#r 8L ro%ra&. (o# can #se as &any as 00 ro%ra&*le'el

:ON:S9 co&&an$s in a ro%ra&.

Secific co&&an$ le'el

a%e 74of

Page 25: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 25/118

AS/400 QUESTION BANK 

3ere t"e :ON:S9 co&&an$ i&&e$iately follo=s a 8L co&&an$. (o#

can #se as &any as 00 co&&an$s*le'el :ON:S9 co&&an$s for a sin%le

co&&an$.

:onitor &essa%e co&&an$ synta

:ON:S9 :S9IC 12 8:CTA 12 EE8 12

:S9IC*5eD#ire$

  EH :S9IC 1:8372

8:CTA 61Otional2

EH :ON:S9 :S9IC 1:8372 8:CTA 1LIB2

EE8 * *1Otional2

8L co&&an$

2 3'at are t'e isaanta-es !f %sin- (L !er )*?

;e can able to rea$ only recor$s b#t =e cannot able to =rite or #$ate or $elete

recor$s.

;e can "a'e only one file to be #se$ in a 8L ro%ra&

;e cannot able to #se rinter files in 8L

;e cannot able to #se s#bfile in a 8L ro%ra&

< ! y!% #an rea an rite sin-le #!an in (L?

By #sin% SNC58F, co&&an$.

 Ea&le

  TyeH 8L

SKANCASA:O/8L

  ACC

 

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 /!ACCIN9 T;O NU:BE5S !/

000.00 9:

0007.00 C8L, ,ILE 1SKANCASA:O/8LS852 58C,:T 1SE8L2

000.00 SNC58F, 58C,:T 1SE8L2

0004.00 839FA5 FA51V5ES2 FALUE1VNU: VNU:72

a%e 7of

Page 26: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 26/118

AS/400 QUESTION BANK 

000.00 SNC58F, 58C,:T1SE8L2

000G.00 ENC9:

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

,I5ST NU:BE5H 7

 SE8ONC NU:BE5H 7

  **********

5ESULT 0000074

  **********

> ! t! retriee a ate in (L?

By #sin% 5TFS(SFAL co&&an$ =e can %et t"e syste& $ates. ,or %ettin% $ate

QCATE.

T"e 'ario#s for&at of $ate are

!C:( !:C( !(:C !((:C !?OL !?OB

$0 ! t! sen t'e essa-e t! t'e s#reen SND*88S?

B( assin% #niD#e &essa%e IC &essa%e $ata an$ &essa%e file.

SNC9::S9 synta

SNC9: :S9 :S9IC 1:S90002 :S9, 1:S9SUB2

$1 3'at is t'e !&en C%ery file?

It is a $yna&ic recor$ selection. T"e ONQ5(, co&&an$ acts as a filter bet=een

t"e rocessin% ro%ra& an$ t"e $atabase recor$s. T"e $atabase file can be a , or L,. It

=ill create oen $ata at"=ay to access 1retrie'e2 $ata file.

If yo# =ant to secify any SQL oeration =it"in a 8L =e "a'e to #se ONQ5(,

,#nctions s#lie$ by ONQ5(, areH

Cyna&ic recor$ selection.

Cyna&ic <eye$ seD#ence access at"

Cyna&ic <eye$ seD#ence access at" o'er a join

Cyna&ic join

3an$lin% &issin% recor$s in secon$ary join files

UniD#e*<ey rocessin%

:ae$ fiel$ $efinitions

a%e 7Gof

Page 27: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 27/118

AS/400 QUESTION BANK 

9ro# rocessin%

,inal total*only rocessin%

I&ro'in% erfor&ance

Oen D#ery i$entifier 1IC2

$. 3'at is t'e ifferent beteen O*NQ)F+ an SQL)*?

O*NQ)F+ SQL)*

ONQ5(, =ill co&e alon% =it" OS/400

syste& an$ no nee$ to "a'e any

a$$itional ac<a%e nee$e$ to eec#te it

;e nee$ to "a'e SQL59 installe$ in

as/400 syste& ="ic" in'ol'es a$$itional

cost to t"e ro%ra&&ers

ONQ5(, is faster as co&are$ to

SQL59

It is slo=er 

ONQ5(, is not"in% b#t a $yna&ic

lo%ical files =ill be create$ an$ t"e

recor$s

SQL59 is i&be$$in% SQL state&ents

$irectly =it"in SQL state&ent

$$. 3'at are t'e ari!%s ste&s in #reatin- O*NQ)F+?

Totally fi'e stes in'ol'e in creatin% ONQ5(,

OF5CB,

,ILE 1file ,2 TO,ILE 1LIB/ ,2 S3A5E 1!(es2

If a , is "a'in% 00 recor$s an$ if =e =ant to o'erri$e t"e ,

so t"at it contin#es only t"e secific n#&ber of recor$s =e are

#sin% OF5CB,

ONQ5(,

,ILE 1LIB / ,2 Q5(SLT 1+E:NO !EQ + !B8AT VA2

If yo# =ant to erfor& any SQL oeration =e "a'e to $eclare in

ONQ5(, co&&an$ only.

In case of ONQ5(, =e can erfor& eression only base$ on

c"aracters b#t not on n#&eric.

!B8AT

a%e 7of

Page 28: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 28/118

AS/400 QUESTION BANK 

If yo# =ant to erfor& any c"arter eression are #sin%

!B8AT eression ="ic" =ill ro'i$e a blan<s in bet=een

t"e 7 'ariables.

;LC85C

It is si&ilar to LIKE in SQL

Q5(SLT 1+E:NA:E !EQ ;LC85C 1>S! >2-2

It =ill fetc" all t"e recor$s ="ose e&na&e starts

fro& S.

!8T

It =ill fetc" all t"e recor$s ="ic" con$itions t"e artic#lar 

c"arter.

Q5(SLT 1+E:NA:E !8T >S@ +2

5AN9E

It =ill fetc" t"e recor$s =it"in t"e secific ran%e

Q5(SLT 1+E:NO !ED 5AN9E 100 02-2

8ALL 9: 1LIB/NA:E2 A5: 12

CLTOF5 

As =e see early t"e &ain file lo%ically o'erri$$en an$ after 

 erfor&in% t"e necessary oeration =e "a'e to $elete t"e lo%ical file

so t"at t"e &ain file contains t"e act#al recor$s for t"is CLTOF5 

=ill be #se$.

CLTOF5 ,ILE 1ON,2

8LO,

;e "a'e to close t"e file ="ic" "as been oene$

8LO, ONIC 1ON,2

(o# =ill coy o'erri$$en file recor$s #sin% 8(,5:Q5(,

8(,5:Q5(,

Since OF5CB, is lo%ical =e cannot able to list t"e 'ariables ="ic"

satisfy t"e D#ery con$ition. To see t"e recor$s bein% selecte$ =e

a%e 7of

Page 29: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 29/118

AS/400 QUESTION BANK 

"a'e to coy fro& t"e so#rce file to a te&orary file for t"is

8(,5:Q5(, =ill be #se$

8(,5:Q5(, ,5O:ONIC 1ON,2 TO,ILE

1LIB/NA:E2 :B5 1!5ELA8E2 85T,ILE 1!(ES2 ,:TOT

1!NO83K2

5UNQ5(

;e "a'e coie$ t"e contents satisfy t"e D#ery into a te&orary file

#sin% 8(,5:Q5(,. If =e r#n t"e $estination file =e %ot t"e

act#al recor$s ="ic" satisfy t"e D#ery.

5UNQ5( Q5(,ILE 1LIN/NA:E2

E7a&le:

Catabase ,

SKANCASA:O/8L

OEN,

 

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 8 UNIQUE

000.00 8 5 ONQ,ILE

0007.00 8 OE:NO S 0

000.00 8 OE:NA:E 70A

0004.00 8 OACC5ESS 70A

000.00 8 OCOB S 0

000G.00 8 K OE:NO

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Cata file

Dis&lay )e&!rt

  OE:NO OE:NA:E OACC5ESS OCOB

 00000 00 SENT3IL SALE: 77007

 000007 007 KU:A5 T5I83( 77000

 00000 00 S3(A: SALE: 74000

 000004 004 5A:ES3 SALE: 0000

a%e 7of

Page 30: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 30/118

AS/400 QUESTION BANK 

 00000 00 BALU SALE: 777

 00000G 00 KU:A5 ?? 7

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

(L &r!-ra

  SKANCASA:O/8L

  ONQ,ILE

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 9:

0007.00 C8L FA51VA2 T(E1!83A52 LEN12

000.00 C8L, ,ILE1SKANCASA:O/ONQ,ILE2

58C,:T1ON,2

0004.00 SNC58F, 58C,:T1ON,2

000.00 839FA5 FA51VA2 FALUE1VOE:NO2

000G.00 OF5CB, ,ILE1OEN,2 S3A5E1!(ES2

000G.0 ONQ5(, ,ILE11SKANCASA:O/OEN,22

Q5(SLT1ROE:NO !EQR

000G.07 !B8AT VA2

000G.0 8(,5:Q5(, ,5O:ONIC1OEN,2

TO,ILE1SKANCASA:O/TE:2

000G.04 :B5OT1!5ELA8E2 85T,ILE1!(ES2000.00 CLTOF5 ,ILE1OEN,2

000.00 8LO, ONIC1OEN,2

000.0 5UNQ5( Q5(,ILE11SKANCASA:O/TE:22

00.00 ENC9:

  !!!!!!!!!!!!!!!!!! En$ of $ata!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUT*UT

  E:LO(EE NU:BE5H 00

 

OE:NO OE:NA:E OACC5ESS OCOB

 00000 00 SENT3IL SALE: 77007

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

a%e 0of

Page 31: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 31/118

AS/400 QUESTION BANK 

$4. ! t'e re#!rs are a##esse f!r %sin- O*NQ)F+?

By creatin% oen $ata at"=ay to access 1retrie'e2 $ata file.

$,. 3'at is t'e "!%rnal?

Any c"an%es in , =ill be recor$e$. A jo#rnal is an object of tye !?5N ="ic"$etects an$ recor$s t"at ca#se a , to c"an%e.

T"e infor&ation recor$e$ by t"e jo#rnal is store$ in an object !?5N58F calle$

 jo#rnal recei'er.

$. 3'at are t'e ari!%s ste&s #reatin- "!%rnal?

T"e stes to start jo#rnalin%

8reate a jo#rnal recei'er * 85T?5N58F

8reate a jo#rnal * 85T?5N

Start jo#rnalin% of a , * ST5?5N,

Bac<# t"e , * SAFOB?

T"e stes to en$ jo#rnalin%

En$ jo#rnalin% a , *ENC?5N,

Celete a jo#rnal *CLT?5N

Celete t"e last jo#rnal recei'er *CLT?5N58F

Sa'e jo#rnal recei'ers *SAFOB?

T"e co&&an$s #se$ for "o#se <eein% #roses

8"an%e jo#rnal *839?5N

Sa'e object *SAFOB?

Celete a jo#rnal recei'er *CLT?5N58F

T"e co&&an$s #se$ in case of a fail#re are

Cislay jo#rnal entries *CS?5N

Aly jo#rnal c"an%es *A(?5N839

5e&o'e jo#rnal c"an%es *5:F?5N839

5estore a sa'e$ object *5STOB?

$2. ! y!% #an list all t'e L+ !f a *+?

a%e of

Page 32: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 32/118

AS/400 QUESTION BANK 

By #sin% CSCB5 co&&an$ it is to list all t"e files ="ic" are relate$ to a ,. It

$islays all t"e L, t"at is referrin% t"e , an$ also lists t"e c"il$ table if it is "a'in%

a relation t"ro#%" ACC,8ST.

$<. 3'at is %se !f DS*++D an DS*+D?

CS,C 1$islay file $escrition2

It is #se$ to $islay t"e $etails abo#t t"e file ="en it is create$.

CS,,C 1$islay file fiel$ $escrition2

It is #se$ for listin% $etails abo#t in$i'i$#al fiel$s.

$>. 3'at is t'e ata C%e%e?

It is a te&orary stora%e. ;e can able to store an$ retrie'e t"e $ata b#t

once $ata is retrie'e$ t"e $ata is lost.

,irst create t"e $ata D#e#e by #sin% 85TCTAA5A co&&an$

Sen$in% a &essa%e to a $ata D#e#e 1QSNCCTAQ Q58FCTAQ An$

8L5CTAQ2

Cata D#ery is not"in% b#t a D#e#e in ="ic" are ro%ra& can sen$ a $ata an$

ot"er ro%ra& or t"e sa&e ro%ra& can recei'e t"e ro%ra&. QSNCCTAQ

is store$ in QS(S.

40. E7&lain QSNDDTAQ an Q)(DTAQ?

QSNCCTAQ

By #sin% t"is co&&an$ sent $ata sa&e / anot"er ro%ra&.

QSNCCTAQ A5: 1QUEUE NA:E LIB VLEN

VCAT2

Q58FCTAQ

By #sin% t"is co&&an$ recei'e $ata sa&e /anot"er ro%ra&

Q58FCTAQ A5: 1QUEUE NA:E LIB VLEN VCAT V;AIT2

41. 3'at are t'e anat!ry &araeters f!r e#larin- a Data  C%e%e?

QUEUE NA:E

LIB NA:E

a%e 7of

Page 33: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 33/118

AS/400 QUESTION BANK 

LEN9T3

CATA

;AIT

4. 3'at ill )UNSQLST8 ill !?

If =e =ant to eec#te set of SQL state&ent t"en =e can =rite all t"e SQL

state&ent to be incl#$in% =it" t"e so#rce.

Tye as SQL

Only insert #$ate an$ $elete an$ no select is allo=e$.

T"en #se ST5SQLST: to eec#te t"e ro%ra&

5UNSQLST: S58,ILE 1LIB/TEST2 S58:B5 1SQL02 8O::IT

1!NONE2

4$. 3'at is a fiel referen#e file?

T"is is , ="ic" $oes not "a'e any $ata an$ contains only t"e fiel$ $escritions

an$ t"ese fiel$s are referre$ in ot"er , by #sin% 5E, an$ 5E,,LC

44. 3'at is t'e ifferen#e beteen O*8G E*8 an )*LE?

O: E: 59LE

Ori%inal ro%ra& &o$el is

t"e ol$ 59/400 syste&

="ic" =ill not allo= a

 ro%ra& tye to call

anot"er ro%ra& tye. Li<e

8L 59 8OBOL L/I

BASI8 only s#orte$.

Eten$e$ ro%ra& &o$el

=ill s#ort 8 AS8AL

,O5T5AN an$ ot"er 

 ro%ra&&in% concets.

It s#orts &ie$ ro%ra&

s#ort in ="ic" yo# can

co&bine any ro%ra& =it"

anot"er tye of ro%ra&. It

s#orts &o$#larity coy

 boo< better call

 erfor&ance.

Fersion is F57 Fersion is F75

4,. E7&lain 3)KOB=*D8 an DS*OB=D?

a%e of

Page 34: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 34/118

AS/400 QUESTION BANK 

;5KOB?C:

If =e =ant to list all t"e so#rce , or files of artic#lar tye t"e

;5KOB?C: =it" file tye as ,*S58 for so#rce , IO5 !file for listin%

all t"e files etra can be %i'en.

CSOB?C

If =e <no= library na&e an$ object na&e an$ =e =ant to <no= t"e so#rce

, ="ere it is resi$in% t"en CSOB?C =it" otion as !ser'ices instea$ of 

 basic =ill %i'e t"e so#rce , na&e.

4. ! t! #reate )*G )*LEG (LG (LLEG *+G L+G *)NG an is&lay file?

59 *by #sin% 85T599: co&&an$

59LE *by #sin% 85TBNC59 8o&&an$ 1or2 4

59LE *by #sin% 85T59:OC 1or2 /85T9: co&&an$

8L *by #sin% 85T8L9: co&&an$

  8LLE *by #sin% 85TBNC8L

  8LLE *by #sin% 85T8L:OC/85T9: co&&an$

  , *by #sin% 85T, co&&an$

  L, *by #sin% 85TL, co&&an$

  5N * by #sin% 85T5T, co&&an$

  CS, *by #sin% 85TCS, co&&an$

42. It is &!ssible t! insert re#!r t! =OIN L+?

 NO insertion #$atin% or $eletin% of recor$s is not ossible in ?OIN L,.

4<. 3'at are t'e aanta-es !f %sin- AS/400 syste?

AS/400 is $esi%ne$ an$ b#il$s as a total syste&. T"is &eans t"at facilities s#c" as

relational $atabase an$ net=or<in% caability 1an$ &#c" &ore2 are f#lly inte%rate$ into t"e

oeratin% syste& an$ &ac"ine. T"e #ser co&&#nication =it" all t"ese f#nctions t"ro#%" a

sin%le control lan%#a%e

Layere$ &ac"ine arc"itect#re

Object orientation

Sin%le*le'el stora%e

3ierarc"y of &icrorocessors

a%e 4of

Page 35: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 35/118

AS/400 QUESTION BANK 

Sec#rity le'els

Layere$ &ac"ine arc"itect#re

T"is ins#lates #sers fro& "ar$=are c"aracteristics. It enables t"e& to

&o'e to ne= "ar$=are tec"nolo%y at any ti&e =it"o#t $isr#tin%

t"eir alication ro%ra&s. ;e can able to c"an%e any layer =it"o#taffectin% t"e ot"er layer. If any roble& occ#rs in OS t"en =e can

=or< =it" alication ro%ra& in$een$ently an$ t"is is t"e &ajor 

a$'anta%e of AS/400 syste&.

Object orientation

E'ery t"at can be store$ or retrie'e$ on t"e syste& is <no=n as an

>objects@. Objects eist to &a<e #sers in$een$ent of t"e internal str#ct#re

of t"e &ac"ine.

Sin%le* le'el stora%e

It ro'i$es conti%#o#s &e&ory bet=een &ain stora%e an$ $is< 

stora%e. It ro'i$es a#t"ority to a$$ any $is< sace so t"at #se. 8an access it

=it"o#t any roble&. T"ere is no nee$ for t"e #ser to t"in< ="ere to store

t"e alication ro%ra&.

3ierarc"y of &icrorocessors

Fario#s tyes of &icrorocessors are #se$ in AS/400. Eac" an$

e'ery &icrorocessor is allocate$ for secific #rose. If one c"i is for 

in#t oeration an$ ot"er for o#t#t t"en =e can $o bot" in#t an$ o#t#t

oeration since bot" t"e &icrorocessor can erfor& in$een$ently.

Sec#rity le'els

It =ill list t"e 'ario#s sec#rity ro'i$e$ by t"e syste&.

 No sec#rity

ass=or$ sec#rity

5eso#rce sec#rity

OS sec#rity

8ertifiable sec#rity

4>. 3'at are t'e ari!%s ty&es !f Se#%rity in AS/400?

a%e of

Page 36: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 36/118

AS/400 QUESTION BANK 

AS/400 is $esi%ne$ for b#siness t"at reD#ires le'els of sec#rity ran%in% fro&

not"in% at all to f#ll %o'ern&ent certifiable sec#rity. By settin% a syste& 'al#e =e

can confi%#re fi'e increasin% le'el of sec#rity.

 No sec#rity

ass=or$ sec#rity

5eso#rce sec#rity

OS sec#rity

8ertifiable sec#rity

;"en as AS/400 is confi%#re$ t"ree syste& 'al#es $ealin% =it" sec#rity nee$ to be

secifie$. T"ese 'al#es are QAUC?5L Q:ASI9N V QSE8U5IT(.

QSE(U)ITF:

T"is syste& 'al#e $eter&ines t"e le'el of sec#rity enforce&ent. S/ an$

t"e ori%inal AS/400 only "a$ t"ree of syste& sec#rity. At FI5 of OS/400 t"e fo#rt"

le'el of sec#rity =as a$$e$ an$ t"e fift" le'el of sec#rity =as a$$e$ at F75. T"e

'ali$ 'al#es for QSE8U5IT( are 0700400.

Q8A;SIN:

T"is syste& 'al#e $eter&ines t"e &ai&#& n#&ber of si%non atte&ts

allo=e$. If t"e n#&ber of #ns#ccessf#l atte&ts to si%non to t"e syste& ecee$s

t"is n#&ber t"e ter&inal or $e'ice t"at atte&te$ t"e si%non is 'arie$ off.

QAUD=)L:

AS/400 s#orts an otional sec#rity a#$itin% f#nction. If t"is f#nction is

secifie$ certain sec#rity e'ents are jo#rnal. T"e secific e'ents t"at are lo%%e$ in

t"e sec#rity a#$it jo#rnal are $eter&ine$ by t"e 'al#e secifie$ in t"e QAUC?5L

syste& 'al#e an$ t"e le'el of syste& sec#rity secifie$.

Leel 10: N! se#%rity

Syste& is s"ie$ =it" &ini&#&*sec#rity le'el an$ $oesn-t reD#ire

any ass=or$ to si%n on. If #ser rofile $oesn-t eists =it" t"e sa&e na&e as t"e

Useri$ t"e syste& creates t"e #ser rofile =it" t"at na&e.

Leel 0:*ass!r se#%rity

a%e Gof

Page 37: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 37/118

AS/400 QUESTION BANK 

:ini&#& sec#rity is acti'e an$ ass=or$ is reD#ire$ to si%n on. T"e

#ser rofile &#st alrea$y eist for t"e #ser before =e can si%n on t"e syste&

Leel $0:)es!%r#e se#%rity

ass=or$ sec#rity is acti'e an$ #ser &#st secify %i'en a#t"ority to

reso#rces. T"is le'el is reco&&en$e$ beca#se t"e syste& $oesn-t %i'e t"e #ser 

a#t"ority to access t"e entire object on t"e syste& after t"e #ser si%n on.

Leel 40:O&eratin- syste se#%rity

ass=or$ sec#rity reso#rce sec#rity an$ OS inte%rity are acti'e.

User &#st be esecially %i'en a#t"ority to reso#rces t"is le'el ro'i$in% &ore

sec#rity t"an le'el 0.

All atte&ts to access object #sin% interfaces t"at are not s#orte$ fail.

ro%ra&s t"at contains restricte$ instr#ctions =ill not co&ile

Users s#b&ittin% jobs #sin% t"e job $escrition containin% t"e #ser 

 rofile na&e &#st "a'e !USE a#t"ority to #ser rofile.

Leel ,0: ( leel se#%rity

All t"e le'el 40 sec#rity attrib#tes are incl#$e$ at le'el 0an$ in

a$$ition so&e of t"e interfaces are &o$ifie$ to &eet t"e 87 stan$ar$s.

,0. E7&lain %ser &r!file an -r!%& &r!file?

User rofiles are #se$ to i$entify #sers to t"e syste&s an$ 'erify a#t"orities

on t"e syste& 1CSUS55, 839US55, ECTOB?AUT2

User rofiles tell t"e syste& ="o can si%n on an$ ="at f#nctions t"e #ser can erfor& on t"e syste& on t"e syste& reso#rces after si%nin% on.

T"e sec#rity officer or sec#rity a$&inistrator can create it.

T"e #ser rofile $efines t"e follo=in% caabilities for a artic#lar #ser 

User class

Object o=ne$ an$ a#t"ori)e$

a%e of

Page 38: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 38/118

AS/400 QUESTION BANK 

A#t"ori)ation of objects

ri'ile%e$ instr#ctions

ass=or$

8#rrent library

Initial ro%ra& an$ &en#

Celi&ite$*caability #ser 

Li&it $e'ice session

:ai&#& stora%e allo=e$

riority li&it

Secial en'iron&ent

User #lass

;"en i$entifyin% a #ser on t"e syste& yo# can secify t"e #ser class in

t"e #ser rofile. AS/400 "as fi'e #ser classes t"at $eter&ine t"e le'el of 

syste&-s access a #ser is er&itte$. T"e fi'e #ser classes startin% t"e "i%"est

le'el of access are

Sec#rity officer 1!SE8O,52

Sec#rity a$&inistrator 1!SE8AC:2

ro%ra&&er 1!9:52

 Syste& oerator 1!S(SO52

User 1!USE52

A%t'!riati!n !f !b"e#ts

Object a#t"ority or t"e ri%"t to #ser to #se or control an object co&es in t=o

cate%ories.

Object ri%"ts

Cata ri%"ts

Ob"e#t ri-'ts

Object ri%"ts are concerne$ =it" t"e object itself.

a%e of

Page 39: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 39/118

AS/400 QUESTION BANK 

Object ri%"ts assi%n a #ser t"e follo=in% a#t"ority

Oerational ri%"ts 1!OE52

Object &ana%e&ent ri%"ts 1!OB?:9T2

Object eistence ri%"ts 1!OB?ET2

  O&erati!nal ri-'t 5HO*E)6T"e a#t"ority to #se an object loo<s at its $escrition an$ restores

it. A #ser &#st "a'e oerational ri%"ts to a ro%ra& to eec#te it.

  Ob"e#t ana-eent ri-'ts 5HOB=8T6

T"e a#t"ority to %rant an$ re'o<e an$ #ser ri%"ts &o'e an$ rena&e

object an$ &e&bers to $atabase file.

  Ob"e#t e7isten#e ri-'ts 5HOB=E;T6

T"e a#t"ority to $elete free stora%e sa'e restore or transfer 

o=ners"i of an object.

Data ri-'ts

Cata ri%"ts aly to t"e $ata containe$ =it"in t"e object.

Tyes of $ata ri%"ts

5ea$ 1!5EAC2

T"e a#t"ority to retrie'e t"e contents of an object entry.

A$$ 1!ACC2

T"e a#t"ority to a$$ entries to an object. ,or ea&le a$$in%

recor$s to a $atabase file reD#ires ACC ri%"ts for t"e library.

U$ate 1!UC2

T"e a#t"ority to c"an%e t"e entries in an object reD#ires UC

ri%"ts for t"e file.

Celete 1!CLT2

T"e a#t"ority to re&o'e object in an object. ,or ea&le $eletin% a

 ro%ra& fro& a library reD#ires CLT ri%"ts for t"e library. Celetin% recor$s

for a $atabase t"e reD#ires CLT ri%"ts t"e $atabase file.

,1. 3'at are t'e ari!%s ays #reatin- a##ess &at'?

a%e of

Page 40: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 40/118

AS/400 QUESTION BANK 

Access at" &eans t"e recor$s are to be retrie'e$ fro& a file. T"e recor$s can be

retrie'e$ fro& a , or a L, eit"er A55IFAL SEQUEN8E or by KE(EC SEQUEN8E.

,or L, yo# can also select recor$s #sin% select or o&it <ey=or$s

Arrial seC%en#e a##ess &at'

SeD#entially ="ere eac" recor$ is ta<en fro& t"e net seD#ential

 "ysical osition in t"e file.

Cirectly by relati'e recor$s n#&ber ="ere t"e recor$ n#&ber is

i$entifie$ by its osition fro& t"e start of t"e file.

Keye seC%en#e a##ess &at'

It is base$ on t"e contents of t"e <ey fiel$s as $efine$ in CCS. T"is tye of 

access at" is #$ate$ in t"e contents of a <ey fiel$ is c"an%e$.

T"ere are t"ree =ays of bo#n$in% t"e access at"

I&&e$iate

5eb#il$

Celaye$

Ieiate

Access at" is al=ays &aintaine$ for e'ery oenin% in a file.

)eb%il

Access at" is &aintaine$ ="en t"e file is oen an$ 'ario#s #$ates are

recor$e$ an$ t"e access at" is reb#il$ e'ery ti&e ="en t"e access at" is close$.

Delaye

Access at" is &aintaine$ ="en t"e file is oene$ an$ #$ates recor$e$.

;"en t"e file is close$ all t"e #$ates to t"e recor$s are close$ to%et"er b#t it is not

reb#il$. ;"en t"e recor$e$ #$ate ercenta%e ecee$s 7 t"en reb#il$ of recor$s

ta<e lace.

,.! any re#!r f!rats *+G L+G DS*+ an S+L?

,* L,* 7 CS,*074 S,L*7

,$.3'at is t'e #!an t! #reate en%?

()T8NU (reate 8en%

a%e 40of

Page 41: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 41/118

AS/400 QUESTION BANK 

,4. 3'at is t'e ifferen#e beteen (ALL an Transfer (!ntr!l 5T+)(TL6?

8ALL T,58TL

.8all =ill transfer t"e control accor$in%

=it" t"e 8ALL STA8K 

Transfer 8ontrol 1T,58TL2 =ill re&o'e t"e

8ALL STA8K an$ transfer t"e control to

t"e callin% ro%ra&.

7. T"e 8ALL is #se$ to $ifferent tyes of 

 ro%ra&s.

EH

59ILE/4008L/4008/4008OBOL/400.

T,58TL is only #se$ in 8L ro%ra&s.

,,. E7&lain ADDDU)G SUBDU)G E;T)(T an TEST?

ADDDU):

It is a o=erf#l oco$e ="ic" is #se$ to a$$ any $ate relate$

f#nction to a artic#lar $ate ti&e or ti&esta&.

E7a&le:

SKANCASA:O/CATE

ACCCU5 

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 $!$ate f#nction #sin% t"e a$$$#r 

000.00 CTI:ESTE S J

000.0 CTI:E S J

0007.00 CCATE S C

0007.0 CCATE7 S C

0007.07 CCATE S C

0007.0 CCATE4 S C

000.00 CTI:E S T

000.0 CTI:E7 S T

000.07 CTI:E S T

000.0 CTI:E4 S T

0004.00 8 :OFEL !CATE CATE

000.00 8 CATE ACCCU5 07H!( CATE7

000G.00 8 CATE ACCCU5 0H!: CATE

000.00 8 CATE ACCCU5 0H!C CATE4

a%e 4of

Page 42: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 42/118

AS/400 QUESTION BANK 

000.0 8 TI:E TI:E

000.07 8 TI:E TI:ESTE

000.00 8 TI:E ACCCU5 0H!3 TI:E7

000.00 8! TI:E ACCCU5 0H!:L TI:E

000.00 8 TI:E ACCCU5 0H!S TI:E4

00.00 8 TI:ESTE ACCCU5 0H!:S TI:E

007.00 8 CATE7 CSL(

00.00 8 CATE CSL(

004.00 8 CATE4 CSL(

004.0 8 TI:E CSL(

004.07 8 TI:E7 CSL(

004.0 8 TI:E CSL(

004.04 8 TI:E4 CSL(

004.0 8 TI:E CSL(

00.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

 CSL( 7004*0G*7

 CSL( 7007**7

 CSL( 7007*0G*7 CSL( 7..G

 CSL( 77..G

 CSL( 00.00.00

 CSL( 7..4G

 CSL( 7007*0G*7*7..G.00

SUBDU):

  It is #se$ to fin$ t"e $ifference bet=een t=o $ate 1or2 ti&e 1or2 ti&e sta&

 Ea&le

SKANCASA:O/CATE

SUBCU5 

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 $!$ate f#nction #sin% t"e SUBCU5 

a%e 47of

Page 43: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 43/118

AS/400 QUESTION BANK 

000.00 CTI:ESTE S J

000.0 CTI:E S J

0007.00 CCATE S C INJ 1CR*0G*70R2

0007.0 CCATE7 S C

0007.07 CCATE S C

0007.0 CCATE4 S C

000.00 CTI:E7 S T INJ 1TR7. 0.0-2

000.0 CTI:E S T

000.07 CTI:E S T

000.0 CTI:E4 S T

000.00 8 CATE SUBCU5 07H!C CATE7

000G.00 8 CATE SUBCU5 0H!: CATE

000.00 8 CATE SUBCU5 0H!( CATE4

000.0 8 TI:E TI:E

000.00 8 TI:E7 SUBCU5 0H!3 TI:E

000.00 8 TI:E7 SUBCU5 0H!S TI:E4

007.00 8 CATE7 CSL(

00.00 8 CATE CSL(

004.00 8 CATE4 CSL(

004.0 8 TI:E CSL(004.07 8 TI:E7 CSL(

004.0 8 TI:E CSL(

004.04 8 TI:E4 CSL(

00.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUT UT

 CSL( *0G*

 CSL( *0*70

 CSL( G*0G*70

 CSL( 07.0.0

 CSL( 7.0.0

 CSL( 00.00.00

 CSL( 7.0.00

a%e 4of

Page 44: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 44/118

AS/400 QUESTION BANK 

E;T)(T:

It is #se$ to etract year &ont" $ay "o#rs &in#tes secon$s an$

&icrosecon$s of a ti&e sta& or $ate fiel$.

E7a&le:

  SKANCASA:O/CATE

  E58T

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 $!,INT T3E E58T CA( :ONT3 (EA5 

000.00 CTI:ESTE S J

0007.00 CCATE S C INJ 1CR*0G*70R2

0007.0 CCATE S C

0007.07 CCATE7 S 0

0007.04 CCATE4 S 0

0007.0 CCATE S 0

0007.0G CCATEG S 0

0007.0 CCATE S 0

0007.0 CCATE S 0

000.00 CTI:E0 S T INJ 1TR7. 0.0-2

000.0 CTI:E S T

000.07 CTI:E7 S 0000.0 CTI:E4 S 0

000.04 CTI:E S 0

000.0 CTI:EG S 0

000.0G CTI:E S 7G 0

0004.00 8 :OFEL !CATE CATE

0004.0 8 TI:E TI:E

0004.07 8 TI:E TI:ESTE

000.00 8 ET58T CATEH!: CATE7

000G.00 8 ET58T CATEH!: CATE4

000.00 8 ET58T CATEH!C CATE

000.0 8 ET58T CATEH!C CATEG

000.07 8 ET58T CATEH!( CATE

000.0 8 ET58T CATEH!( CATE

a%e 44of

Page 45: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 45/118

AS/400 QUESTION BANK 

000.04 8 ET58T TI:EH!3 TI:E7

000.0 8 ET58T TI:EH!3 TI:E4

000.0G 8 ET58T TI:E0H!3 TI:E

000.0 8 ET58T TI:E0H!S TI:EG

00.00 8 ET58T TI:ESTEH!:S TI:E

007.00 8 CATE7 CSL(

00.00 8 CATE CSL(

00.0 8 CATE4 CSL(

00.07 8 CATE CSL(

00.0 8 CATEG CSL(

004.00 8 CATE CSL(

004.0 8 TI:E7 CSL(

004.07 8 TI:E4 CSL(

004.0 8 TI:E CSL(

004.04 8 TI:EG CSL(

004.0 8 TI:E CSL(

00.00 8 SETON L5 

OUTUT

CSL( G CSL( 7007

 CSL( G

 CSL( 70

 CSL( 7

 CSL(

 CSL( 7

 CSL( 7

 CSL( 7

 CSL( 0

 CSL( 44000

TEST:

Test is t"e &ost o=erf#l oco$e ="ic" =ill c"ec< a $ate is a 'ali$ or not .T"e lo=

le'el in$icator is set on if t"e $ate is not 'ali$ or set off if t"e $ate is a 'ali$ one.

a%e 4of

Page 46: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 46/118

AS/400 QUESTION BANK 

Test =ill be %i'en =it" eten$e$ factor li<e test 1$2 test 1t2 test 1)2 for $ate ti&e

an$ ti&e sta& an$ if test =it"o#t eten$e$ factor $efa#lt to $ate 1)2.

E7a&le

SKANCASA:O/CATE

TEST

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 8!TEST ,O5 FALIC CATE T3E CATE FALIC SETO,, O5 SETON

1NOTFALIC2

000.00 8 :OFEL R/0/- A 0

0007.00 8 TEST 1C2 A 0

000.00 8 !IN0 CSL(

000.0 8 I, !IN0!ON

000.07 8 RNOTFAILCR CSL(

000.0 8 ELSE

000.04 8 RFALICR CSL(

000.0 8 ENCI,

0004.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( CSL( NOTFAILC

56. E7&lain 8%lti Diensi!nal Array?

T"e &#lti $i&ension $ata str#ct#re array =ill be i&le&ente$ in occ#rs class.

 T"e si&ilar ele&ents of sa&e $ata tye an$ sa&e attrib#tes si)e reeatin% &any

ti&es t"is ti&e #sin% O88U5 oco$e.

;"ic" can only be #se$ =it" a &#ltile occ#rrence $ata str#ct#re allo= yo# to

secify ="ic" occ#rrence of $ata str#ct#re is #se$ for s#bseD#ent oeration

=it"in t"e ro%ra&s.

,2. E7&lain ab!%t )TN(S)LO(?

Tye ( 1(es2 in t"e Select ara&eters ro&ts to $efine ara&eters for t"e

5TN8S5LO8 <ey=or$ on t"e Cefine 5et#rn 8#rsor Location $islay.

a%e 4Gof

Page 47: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 47/118

AS/400 QUESTION BANK 

,<. E7&lain Ass%e an Oerlay?

  Ass%e

Tye ( 1(es2 to select t"e ASSU:E <ey=or$. It ca#ses t"e AS/400 syste&

to ass#&e t"at t"is recor$ aears on t"e $islay ="en t"e file is oene$. Use t"is

<ey=or$ to recei'e $ata t"at a re'io#s ro%ra& "as left on t"e $islay.

Oerlay

Tye ( 1(es2 to allo= t"e o'erlayin% of fiel$s on t"is recor$ =it"o#t erasin%

t"e entire $islay. NoteH If yo# tye anyt"in% ot"er t"an ( or blan< yo#r entry =ill

 be i%nore$. (o# &#st secify t"e OFE5LA( <ey=or$ to select t"e ot"er <ey=or$s

on t"is $islay =it" t"e ecetion of UTOF5.

,>. E7&lain (!&ile tie arrayG l!!9%&G s!rtaG 7f!!tG an )%n tie array?

(!&ile tie array

T"e co&ile ti&e array &eans t"e ele&ents of t"e array =ill be loa$e$

 before t"e eec#tion of t"e ro%ra&s.

T"e 'al#e =ill be static.

;e &#st $eclare in <ey=or$ co&&an$ CI: 12 8TCTAT 12 an$ E558C

12.

;e are %i'in% t"e 'al#e in after t"e SETON L5.

E7a&le

SKANCASA:O/A55A(

8O:ILE

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 c!co&ile ti&e array

000.00 $arr s 4 $i&12 ct$ata errc$12

0007.00 $i s 7 0 in)12

000.00 c i $o 0004.00 c arr1i2 $sly

000.00 c a$$ i

000G.00 c en$$o

000.00 c seton

000.00 !!

000.00 00

a%e 4of

Page 48: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 48/118

AS/400 QUESTION BANK 

000.00 70

00.00 000

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( 00

 CSL( 70

CSL( 000

)%n tie array

T"e r#n ti&e array &eans t"e 'al#e =ill be loa$e$ $#rin% t"e r#nti&e

only.

T"e 'al#e =ill be $yna&ic.

SKANCASA:O/A55A(

  5UNTI:E

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 c!r#nti&e array

000.00 $arr s 0 $i&172

0007.00 $i s 7 0 in)12

0007.0 $a s 0

0007.07 $j s 7 0 in)12

000.00 c i $o 7

000.0 c $sly arr1i2

000.07 c! e'al arr1i2a

000.0 c a$$ i

000.04 c en$$o

000.0 c j $o 7

0004.00 c arr1j2 $sly

000.0 c a$$ j

000G.00 c en$$o

000.00 c seton lr 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 l!!9%&G s!rtaG 7f!!t :

  SKANCASA:O/A55A(

SO5TA55A(

a%e 4of

Page 49: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 49/118

AS/400 QUESTION BANK 

 

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 c!loo<#footVsorta ea&les

000.00 $arr s 4 0 $i&12 ct$ata errc$12

0007.00 $i s 7 0 in)12

0007.0 $j s 7 0 in)12

0007.07 $$ s 4 0

000.00 c i $o

0004.00 c arr1i2 $sly

000.00 c a$$ i

000G.00 c en$$o

000G.0 c sorta arr

000G.07 c foot arr $

000G.0 c 000 loo<# arr 40

000G.04 c if !in40!on

000G.0 c Rfo#n$R $sly

000G.0G c else

000G.0 c Rnotfo#R $sly

000G.0 c en$if 

000G.0 c $ $sly000G.0 c j $o

000G. c arr1j2 $sly

000G.7 c a$$ j

000G. c en$$o

000.00 c seton

000.00 !!

000.00 00

000.00 7000

00.00 000

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CSL( 00

 CSL( 7000

 CSL( 000

a%e 4of

Page 50: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 50/118

AS/400 QUESTION BANK 

 CSL( fo#n$

 CSL( 400

 CSL( 000

 CSL( 00

 CSL( 7000

*re r%ntie array

re r#nti&e array is in bet=een t"ese 7 con$itions ="ere t"e 'al#es are static

an$ t"e 'al#e =ill be retrie'e$ fro& $is< an$ loa$e$ into t"e array.

As a res#lt t"ere is no nee$ to retrie'e t"e 'al#e e'ery ti&e fro& t"e $is< an$

#sa%e of re r#nti&e array &a<es it fast.

;e &#st $eclare in <ey=or$ co&&an$ CI: 12 ,5O:,ILE 12 an$ E558C

12.

0. Define ata str%#t%re an ty&es !f ata str%#t%re?

T"e $ifferent tye-s fiel$s an$ s#b fiel$ store$ =it" in sin%le area. T"is area in

stora%e is calle$ $ata str#ct#re.

Cata str#ct#re &eans ro%ra& allo=s yo# to $efine an area in stora%e an$ t"e layo#t

of t"e fiel$s calle$ s#b fiel$s =it" t"e area. T"is area in stora%e is calle$ a $ata str#ct#re.

Data str%#t%re #an be %se f!r

9ro# non*conti%#o#s $ata into conti%#o#s internal stora%e locations

Cefine t"e sa&e internal area &#ltile ti&es #sin% $ifferent $ata for&ats.

Oerate on a fiel$ an$ c"an%e its contents

Ci'i$e a fiel$ into s#b fiel$s =it"o#t #sin% t"e :OFE or :OFEL

Cefine a $ata str#ct#re an$ its s#b fiel$s in t"e sa&e =ay a recor$ is $efine$.

Cefine &#ltile occ#rrences of a set of $ata

T"ere are fo#r $ifferent tyes of $ata str#ct#re co&&only #se$.

9eneral $ata str#ct#re

Cata area $ata str#ct#re

,ile infor&ation $ata str#ct#re

ro%ra& stat#s $ata str#ct#re

Cata str#ct#re can be secifie$ in C sec

Tye ICS

Data str%#t%re nae

a%e 0of

Page 51: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 51/118

AS/400 QUESTION BANK 

I lobally initiali)e$ $ata str#ct#re

S@@*ro%ra& stat#s $ata str#ct#re

U@@Data area $ata str#ct#re

Blan9s M eneral 1or2 +ile stat#s $ata str#ct#re

Data area ata str%#t%re

A $ata area $ata str#ct#re i$entifie$ by a U in osition of t"e $ata str#ct#re

state&ent in$icates to t"e 59LE ro%ra& t"at if s"o#l$ rea$ in an$ loc< t"e $ata area

of t"e sa&e na&e at ro%ra& at ro%ra& initiali)ation an$ s"o#l$ =rite o#t an$ #nloc< 

t"e sa&e $ata area at en$ of t"e ro%ra&.

T"e $ata area an$ $ata area str#ct#re &#st "a'e t"e sa&e na&e #nless yo#

rena&e t"e $ata =it"in t"e ro%ra& by #sin% t"e !NA:FA5 CE,INE state&ent.

+ile inf!rati!n ata str%#t%re

A file infor&ation $ata str#ct#re ro'i$es yo# =it" stat#s infor&ation on file

ecetion /error occ#rs. T"is $ata str#ct#re na&e &#st be #niD#e for eac" file. It consists of 

 re $efine$ s#b fiel$s t"at ro'i$e infor&ation on t"e file ecetion/error t"at occ#rre$.

*r!-ra stat%s ata str%#t%re

T"is $ata str#ct#re is i$entifie$ by as S in osition of t"e $ata str#ct#re

state&ent ro'i$es ro%ra& ecetion/error infor&ation to t"e ro%ra&. T"e

!5OUTINE !STATUS !A5: <ey=or$s &ostly referre$ to $eter&ine t"e S CS.

 Ea&le

  SKANCASA:O/CATAST5 

  CU:

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!

000.00 3CEBU91!(ES2

0007.00 CSS5 SCS

0004.00 CSTATUS !stat#s

000.00 C5OUTINE !ro#tine

000.0 CA5:S !ar&s

000.07 C5ES S 7S 0

000.00 8 J*ACC NU: 7 0

000.0 8 J*ACC 0 NU:7 7 0

000.00 8 EFAL 5ESNU:/NU:7

a%e of

Page 52: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 52/118

AS/400 QUESTION BANK 

00.00 8 RNOT8O:R CSL(

007.00 8 A TA9

00.00 8 R8O:IN9R CSL(

004.00 8 SETON L5 

00.00 8 !SS5 BE9S5 

00G.00 8 STATUS CSL(

00.00 8 5OUTINE CSL(

00.00 8 A5:S CSL(

00.00 8 CU:

0070.00 8 9OTO A

007.00 8 ENCS5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

O#t#t

CSL( 07

 CSL( !CET8

 CSL( 0

 CSL( 8O:IN9

1. 3'at is L!#9? ! y!% a#'iee in AS/400?

To %i'e t"e access er&ission for $atabase file. T"e Loc<s are ro'i$e$ by AS/400syste& itself.

Tye of loc< 

S"are loc< 

T"e s"are loc< only rea$in% oeration 1, file2.

Ecl#si'e loc< 

T"e ecl#si'e loc< to erfor& insert #$ate an$ $elete oerations.

. ! y!% ill release t'e l!#9?

By #sin% 58L5S8 5eclai& 5eso#rce co&&an$ =e can release t"e reso#rces

only. UNLO8K or 83AIN 1N2 co&&an$ also "els to release t"e loc<.

By #sin% ;5KOB?L8K co&&an$ an$ ta<e ,4.

 

$. ! y!% e7e#%te (L #!an in )*LE?

a%e 7of

Page 53: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 53/118

AS/400 QUESTION BANK 

By #sin% Q8:CE8 co&&an$ =e can eec#te 8L co&&an$ in 59LE. T=o

 ara&eters =ill be calle$ #se in t"e 8L co&&an$ to be eec#te$ an$ secon$ is t"e len%t"

of t"e co&&an$.

4. E7&lain (!itent (!ntr!l?

T"e AS/400 syste& "as an inte%rate$ transaction reco'ery f#nction calle$

co&&it&ent control. 8o&&it&ent control is an etension of t"e jo#rnal f#nction on t"e

syste&.

T"e recor$s #se$ $#rin% a co&le transaction are loc<e$ fro& ot"er #ser an$ at t"e

en$ of t"e transaction t"e ro%ra& iss#es t"e #!it !&erati!nG #$atin% t"e recor$s.

 If t"e syste& fails before t"e co&&it oeration is erfor&e$ all $atabase c"an%es

are r!lle ba#9  to t"e re'io#s co&&it oeration an$ all t"e affecte$ recor$s are #nloc<e$.

(O88IT@T"e transactions are #$ate$ in t"e $ata file. 8o&&it occ#rs on(O88IT co&&an$

)OLLBA(K * T"e transactions are NOT #$ate$ in t"e $ata file. 5ollbac< occ#rs

if t"ere are #nco&&itte$ transactions an$ on )OLLBA(K  co&&an$.

,. E7&lain ab!%t s%b files in AS/400?

A s#bfile is a %ro# of recor$s 5EAC fro& or ;5ITTEN to a $islay $e'ice

file in one sin%le oeration.

It is a $islay file facility

It is a %ro# of recor$s t"at can be store$ in t"e &ain &e&ory.

T"e ro%ra& can store a %ro# of recor$s in t"e s#bfile one by one in a

seD#ence.

LODIN SUB+ILES:

Loa$ all 1Si)e Pa%e2

Loa$ on $e&an$ 1Si)e Pa%e2

Loa$ on $e&an$ 1Si)e a%e2

L!a all 5Sie J*a-e6

All t"e recor$s fro& t"e $atabase file =ill be loa$e$ in to t"e s#bfile in

one s"ot.

T"e s#bfile si)e s"o#l$ be %reater t"an t"e a%e si)e at least by one.

1S,LSIJ S,LA942. T"e s#bfile si)e =ill $yna&ically %ro= ="en

a%e of

Page 54: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 54/118

AS/400 QUESTION BANK 

t"e s#bfile si)e &entione$ is less t"an t"e n#&ber of recor$s in t"e

$atabase file.

A9EU an$ A9ECO;N are ta<en care of by t"e syste&.

T"e total s#bfile si)e recor$s.

L!a !n ean 5Sie J *a-e6

T"e n#&ber of recor$s as &entione$ in S,LA9 =ill be loa$e$

initially.

  T"en t"e re&ainin% recor$s can be loa$e$ by ressin%

*AEDO3N ="ic" is ta<en care of by t"e ro%ra&&er.

Sa&e ti&e *AEU* is ta<en care of by t"e syste&.

T"e s#bfile si)e s"o#l$ be %reater t"an t"e a%e si)e at least by one.

1S,LSIJ S,LA942. T"e s#bfile si)e =ill $yna&ically %ro= ="ent"e s#bfile si)e &entione$ is less t"an t"e n#&ber of recor$s in t"e

$atabase file.

All t"e recor$s loa$e$ =ill eist in t"e s#bfile.

T"e total s#bfile si)e recor$s.

L!a !n ean 5Sie *a-e6

T"e n#&ber of recor$s t"at =ill be loa$e$ into t"e s#bfile &#st

al=ays be eD#al to t"e 'al#e &entione$ in for S,LSIJ an$ S,LA9.

E'ery ti&e t"e s#bfile s"o#l$ be cleare$ before a%in% # or a%in%

$o=n.

*AEU* an$ *AEDO3N are ta<en care of t"e ro%ra&&er.

T"e n#&ber of recor$s t"at can be in t"e s#bfile at any instance =ill

 be eD#al to S,LSIJ an$ S,LA9 'al#es.

S%bfile &!ints:

5ecor$ for&atsH

One $islay *074 recor$s for&ats

One $islay file 67 s#bfile

5ecor$ for&ats are

.s#bfile recor$ for&at 1S,L2

a%e 4of

Page 55: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 55/118

AS/400 QUESTION BANK 

7.s#bfile control recor$ for&at 1S,L8TL2

s#bfile recor$ for&at1S,L2

T"is recor$ for&at =ill "a'e t"e &#ltile recor$ $efinitions

*Cefinin% fiel$s.

*Cefinin% $atabase fiel$s.

S#bfile 8ontrol recor$ for&at 1S,L8TL2

T"is recor$ for&at =ill control t"e s#bfile recor$ for&at.

*Cefinin% tets

*Cefinin% control fiel$s.

S#bfile Si)e 1S,LSIJ2

T"is <ey=or$ can be #se$ to secify t"e &ai&#& n#&ber of recor$s t"at

can be in t"e s#bfile 1b#ffer2

Cefa#lt *P7

:ai&#& *P

S#bfile a%e 1S,LA92

T"is <ey=or$ can be #se$ to secify t"e &ai&#& n#&ber of recor$s t"at

can be in one s#bfile a%e. T"at is t"e &ai&#& n#&ber of recor$s t"at t"e syste&

=ill $islay in t"e screen at a ti&e.

*Cefa#lt *P*:ai&#&*P $een$s #on t"e $islay recor$ si)e.

If t"e s#bfile si)e is at least one %reater t"an t"e s#bfile a%e t"en t"e s#bfile

si)e =ill %ro= $yna&ically # to .

eneral 9ey!rs

S,LCS *P s#bfile $islay

S,LCS8TL *P s#bfile $islay control

S,L8L5 *P s#bfile clear  

S,LENC *P s#bfile en$

Define eneral Key!rs

 S#bfile control recor$ . . . . . . . . . H SEN;LT

 Tye c"oices ress Enter. Key=or$

  5elate$ s#bfile recor$ . . . . . . . S,L8TL SEN;NC Na&e

  S#bfile c#rsor relati'e recor$ . . . S,L8S555N Na&e

a%e of

Page 56: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 56/118

AS/400 QUESTION BANK 

  S#bfile &o$e . . . . . . . . . . . . S,L:OCE Na&e

  ((es In$icators/

  Cislay s#bfile recor$s . . . . . . S,LCS F ,

  Cislay control recor$ . . . . . . . S,LCS8TL F

  Initiali)e s#bfile fiel$s . . . . . S,LINJ

  Celete s#bfile area . . . . . . . . S,LCLT

  8lear s#bfile recor$s . . . . . . . S,L8L5 <

  In$icate &ore recor$s . . . . . . . S,LENC $0

  S,LENC ara&eter . . . . . . . . !:O5E F

  S,LENC ara&eter . . . . . . . . !S85BA5 !:O5E ...

  5ecor$ not acti'e . . . . . . . . . S,L5NA

  :ore...

 ,Eit ,78ancel

S#bfile Cislay 1S,LCS2

T"is <ey=or$ is #se$ to insert t"e syste& t"at t"e s#bfile recor$s for&at "as

to be $islaye$. T"e s#bfile recor$ for&at =it"o#t any recor$ in it cannot be

$islaye$.

S#bfile Cislay control 1S,LCS8TL2

T"is <ey=or$ is #se$ to instr#ct t"e syste& t"at t"e s#bfile control recor$

for&at "as to be $islaye$.000.00 8 N0 SETON 77G

S#bfile 8lear 1S,L8L52

T"is <ey=or$ is #se$ to clear t"e recor$s in t"e s#bfile recor$s for&at.

An in$icator can control t"is <ey=or$.

000.00 8 SETON 7

000G.00 8 ;5ITE SEN;LT

000.00 8 SETO,, 7

S#bfile En$ 1S,LENC2

T"is <ey=or$ is #se$ to %et t"e $islay of +- si%n or a tet +&ore- or 

+botto&- in t"e botto& of t"e s#bfile.

+ or +&ore- in$icates t"e eistence of &ore recor$s in t"e s#bfile ="ic" can

 be $islaye$ by ressin% *AEDO3N <ey .

Botto&- in$icates t"e en$ of t"e s#bfile.

a%e Gof

Page 57: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 57/118

AS/400 QUESTION BANK 

 Instea$ of Enter Key * 3el Tye a 8, or 8A <ey n#&ber to secify t"at

t"e oerator is to #se t"e Enter <ey as a 5oll U <ey. T"e secifie$ 8, or 

8A <ey acts as t"e Enter <ey.

8anat!ry 9ey!rs f!r s%bfile

S,L

S,L8TL

S,LSIJ

S,LA9

S,LCS

))N 5)elatie re#!r n%ber6 5control recor$ le'el <ey=or$2

55N is t"e n#&eric 'al#e 1 to 2 associate$ =it" eac" s#bfile recor$

for accessin%

Eac" recor$ s"o#l$ "a'e a #niD#e 55N 'al#e

T"is 'al#e "as to be %i'in% by t"e ro%ra&.

T"is "as to be associate$ =it" t"e s#bfile recor$ for&at in t"e , sec

contin#ation line.

T"is "as to be $eclare$ in t"e ro%ra& as n#&eric 'ariable of &ai&#&

len%t" 4 an$ $eci&al osition 0.

, sec for&at in contin#ation line =it" S,ILE otion

0007.00 ,SENCES,ILE8, E ;O5KSTN

000.00 , S,ILE 1S,L0H55N 2

;"ere 55N *P 55N 'ariable na&e

S,L0*P s#bfile recor$ for&at na&e.

59LE Oco$es

E,:T

If S,LCS an$ S,LCS8TL in$icators are on t"is oco$e =ill sen$

t"e t=o s#bfile recor$ for&ats to t"e $islay $e'ice an$ =aits for t"e #ser-s

resonse.

;5ITE 61S,L2

a%e of

Page 58: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 58/118

AS/400 QUESTION BANK 

T"is oco$e is #se$ to a$$ a recor$ to t"e s#bfile recor$ for&at

55N 'al#e s"o#l$ be set =it" a non*eistin% 'al#e before a$$in%

t"e recor$ in t"e s#bfile recor$ for&at.

;5ITE 1S,L8TL2

T"is <ey=or$ is #se$ for clearin% V $islay t"e s#bfileS+LD)O* 5s%bfile r!&6

T"is control recor$ le'el <ey=or$ is #se$ to assi%n a 8A 1co&&an$

attention2 or 8, 1co&&an$ f#nction2 <ey. T"e ro%ra& first $islays t"e s#bfile in

tr#ncate$ for& s#bfile recor$s are tr#ncate$ to fit on one $islay line. ;"en t"e

#ser resses t"e secifie$ <ey t"e ro%ra& $islays t"e recor$s in t"e fol$e$ for&.

Or 

  S#bfile Initially Tr#ncate$ * 3el Tye a co&&an$ f#nction 18,2 or 

co&&an$ attention 18A2 <ey n#&ber to assi%n a 8, or 8A <ey to secify if a

s#bfile control recor$ reD#irin% &ore t"an one $islay line s"o#l$ be tr#ncate$ to

one line or s"o#l$ be fol$e$ to $islay on t=o lines. ;"en t"is <ey=or$ is

secifie$ t"e s#bfile is first $islaye$ in tr#ncate$ for&. T"e oerator resses t"e

secifie$ 8, or 8A <ey to s=itc" fro& tr#ncate$ for& to fol$e$ for& or fro&

fol$e$ for& to tr#ncate$ for&.

S+L+OLD 5s%bfile f!l6

T"is control recor$ le'el <ey=or$ is #se$ to assi%n a 8A 1co&&an$

attention2 or 8, 1co&&an$ f#nction2 <ey. T"e ro%ra& first $islays t"e s#bfile in

fol$e$ for&. ;"en t"e #ser resses t"e secifie$ <ey t"e ro%ra& $islays t"e

recor$s a%ain in t"e tr#ncate$ for&.

Or 

S#bfile Initially ,ol$e$ * 3el Tye a co&&an$ f#nction 18,2 or co&&an$

attention 18A2 <ey n#&ber to assi%n a 8, or 8A <ey to secify if a s#bfile control

recor$ reD#irin% &ore t"an one $islay line s"o#l$ be tr#ncate$ to one line or 

s"o#l$ be fol$e$ to $islay on t=o lines. ;"en t"is <ey=or$ is secifie$ t"e

s#bfile is first $islaye$ in fol$e$ for&. T"e oerator resses t"e secifie$ 8, or 

8A <ey to s=itc" fro& fol$e$ for& to tr#ncate$ for& or fro& tr#ncate$ for& to

fol$e$ for&.

a%e of

Page 59: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 59/118

AS/400 QUESTION BANK 

S+LINM 5s%bfile initialie6

T"is control recor$ le'el <ey=or$ is #se$ to secify t"at t"e ro%ra& is to

initiali)e all recor$s in t"e s#bfile on t"e o#t#t oeration 1rea$ V #$ates2 to t"e

s#bfile control recor$ for&at.

T"e fiel$s in eac" s#bfile recor$ are initiali)e$ to

83A5*PBLANKS

 NU:E*PJE5OS

,LOAT*PNULLS

S+LN;T( 5s%bfile ne7t #'an-e6

T"is recor$ le'el <ey=or$ is #se$ on t"e s#bfile control recor$ for&at to

force t"e #ser to correct ro%ra&*$etecte$ <eyin% error in t"e s#bfile recor$s t"at

"a'e been rea$ by t"e ro%ra&. It $oes t"is by ca#sin% t"e recor$ to be c"an%e$ so

t"at a %et*net*c"an%e$ oeration &#st rea$ t"e recor$.

Or 

5et#rn 5ecor$ * 3el Tye ( 1(es2 to instr#ct t"e syste& to ret#rn t"is

s#bfile recor$ to yo#r ro%ra& on a s#bseD#ent 9et*Net*8"an%e$ in#t oeration

to t"e s#bfile. T"is recor$ is ret#rne$ ="et"er or not t"e oerator c"an%es it.

 NoteH (o# &#st tye (. If yo# $o not t"e entry =ill not be #se$. X(o# can secify

con$ition in$icators for t"e S,LNT839 <ey=or$.

S+L)OLAL 5s%bfile r!ll al%e6

T"is fiel$*le'el <ey=or$ is #se$ to secify t"at t"e #ser can <ey a 'al#e into

t"is fiel$ to tell t"e ro%ra& "o= &any recor$s to A9EU or A9ECO;N ="en

t"e aroriate a%in% <ey is resse$.

S+L)(DNB) 5s%bfile re#!r n%ber6

T"is fiel$ le'el <ey=or$ on t"e s#bfile control recor$ for&at is #se$ to

secify t"at t"e a%e of t"e s#bfile to be $islaye$ is t"e a%e containin% t"e recor$

="ose relati'e recor$ is in t"is fiel$. If yo# $o not secify t"is <ey=or$ t"e

 ro%ra& $islays t"e first a%e of t"e s#bfile by $efa#lt

Ea&le for l!a all

SKANCASA:O/SUB,ILE

  NE;E:

a%e of

Page 60: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 60/118

AS/400 QUESTION BANK 

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!

000.00 UNIQUE

0007.00 5 E:NE;

000.00 E:NO: G 0 TET1RE:LO(EE NU:BE5R2

0004.00 E:NA A TET1RE:LO(EE NA:ER2

000.00 SE A TET1RE:LO(EE SER2

000G.00 A9E 0 TET1RE:LO(EE A9ER2

000.00 ACC5ESS A TET1RACC5ESSR2

000.00 8IT( 0A TET1R8IT(R2

000.00 K E:NO:

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CATA ,ILE

  Dis&lay )e&!rt

 

E:NO: E:NA SE A9E ACC5ESS 8IT(

 00000 0 K.SENT3ILKU:A5 : 7 ATTU5 SALE:

 000007 07 5.S3(A:SUNCA5 : 7 T5I83( T5I83(

 00000 0 B.:O3AN : 7 T8OCE SALE:

 000004 04 K.KU:A5 : 7 SALE: SALE:

 00000 0 A.A5UL : 7 SALE: NA:AKKAL 00000G 0G BALU : 7 SALE: SALE:

 00000 0 SENT3IL : SALE: T5I83(

 00000 0 5A? : 77 T8OC;E SALE:

 00000 0 3E:A : SALE: 83ENNAI

 00000 0 FEL : G SALE: SALE:

 0000 5A:ES3 : G ATTU5 SALE:

 00007 77 SUC3A : 7 SALE: ATTU5 

 0000 7 KANCASA:( : 4 SALE: ATTU5 

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

SKANCASA:O/SUB,ILE

  SUB04

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!

0007.00 ,SENCES,ILE8, E ;O5KSTN

a%e G0of

Page 61: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 61/118

AS/400 QUESTION BANK 

00.00 8 !IN0 CO;EQ !O,,

00G.00 8 E,:T :AIN

00G.0 8 I, !IN04!ON ANC E:8U5RE:NO:R

00G.07 8 8ALL RSELOACALLR

00G.0 8 ENCI,

00.00 8 0 LEAFE

00.00 8 ENCCO

00.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SKANCASA:O/SUB,ILE

  SELOACALL

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 ,NE;E: I, E CISK 

0007.00 ,SENCES,ILE8, E ;O5KSTN

000.00 , S,ILE1SEN;NCH55N2

0004.00 8 J*ACC 55N 4 0

000.00 8 SETON 7

000G.00 8 ;5ITE SEN;LT

000.00 8 SETO,, 7

000.00 8 5EAC E:NE; 0000.00 8 N0 SETON 77G

000.00 8 CO; !IN0!O,,

00.00 8 ;5ITE SEN;NC

007.00 8 ACC 55N

00.00 8 5EAC E:NE; 0

004.00 8 0 LEAFE

00.00 8 ENCCO

00G.00 8 CO; !IN0!O,,

00G.0 8 0 LEAFE

00G.07 8! ;5ITE 3EATE5 

00G.0 8! ;5ITE ,OOTE5

00G.04 8 E,:T SEN;LT

0070.00 8 ENCCO

a%e Gof

Page 62: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 62/118

AS/400 QUESTION BANK 

007.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

in! ain1 ta<e

  Sele#t )e#!r Key!rs

 5ecor$ . . . H :AIN

 Tye c"oices ress Enter.

  ((es

  9eneral <ey=or$s . . . . . . . . F

  In$icator <ey=or$s . . . . . . . F

  Alication "el . . . . . . . .

  Sele#t eneral Key!rs

 5ecor$ . . . H :AIN

 Tye c"oices ress Enter. Key=or$ ((es

  If t"is recor$ is not on $islay =rite it

  to t"e $islay before iss#in% rea$ . . . . . . . INJ58C

  Kee recor$ on $islay . . . . . . . . . . . . . . KEE

  Ass#&e recor$ is on $islay . . . . . . . . . . . ASSU:E F  Allo= rollin% of lines . . . . . . . . . . . . . . AL;5OL

  5etain 8LEA5 3EL 3O:E an$ 5OLL <eys . . . . . . . 5ETKE(

  5etain co&&an$ f#nction 18,nn an$ 8Ann2 <eys . . . 5ET8:CKE(

  8"an%e in#t $efa#lts . . . . . . . . . . . . . . 839INC,T

  Select ara&eters . . . . . . . . . . . . . . .

  :en#*Bar $islay . . . . . . . . . . . . . . . . . :NUBA5CS

  Select ara&eters . . . . . . . . . . . . . . .

  Entry fiel$ attrib#te . . . . . . . . . . . . . . ENT,LCAT5 

  Select ara&eters . . . . . . . . . . . . . . .

  5et#rn c#rsor location . . . . . . . . . . . . . . 5TN8S5LO8 F

  Select ara&eters . . . . . . . . . . . . . . .

  Define )et%rn (%rs!r L!#ati!n

 5ecor$ . . . H :AIN

a%e G7of

Page 63: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 63/118

AS/400 QUESTION BANK 

  Key=or$ n#&ber 5oll

  of ( /*

  ,4 for list

 Tye ara&eters ress Enter.

  Key=or$

 5et#rn c#rsor location . . . . . . . . . . 5TN8S5LO8 F ((es

  Tye in$icator !5E8NA:E . . . . . . . . F ((es

  8#rsor recor$ . . . . . . . . . . . . . )E(SD  Na&e

  8#rsor fiel$ . . . . . . . . . . . . . . E8*(U)  Na&e

  8#rsor osition . . . . . . . . . . . . Na&e

(+0$ 0$

 (+04 04

TAKE 1 AND +4

  3!r9 it' +iels

 5ecor$ . . . H :AIN

 Tye infor&ation ress Enter.

  N#&ber of fiel$s to roll . . . . . . . . . . . . . . . . . . G

 Tye otions c"an%e 'al#es ress Enter.

  Select <ey=or$s 4Celete fiel$ Otion Or$er ,iel$ Tye Use Len%t" 5o=/8ol 5ef 8on$ition O'erla

  0 A9E 8 7 04

  <0 )E(SD A 10

  >0 E8*(U) A 10

  00 ********** 8 G 7 00

  0 ,*PEIT 8 77 00

  70 E:NO: S B G0 0 0G (

  :ore...

  A$$ 3 3i$$en

  A$$ : :essa%e

  A$$ ro%ra&*to*syste&

a%e Gof

Page 64: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 64/118

AS/400 QUESTION BANK 

TAKE 1

SEN3LT1

  Sele#t 3in! Key!rs

 ;in$o= recor$ . . . . . . . . . . . . . H SEN;LT

 Tye c"oices ress Enter.

  ((es

  9eneral <ey=or$s . . . . . . . . F

  Select recor$ <ey=or$s . . . . . F

  9eneral S,L8TL <ey=or$s . . . . . F

  S#bfile $islay layo#t . . . . . F

  S#bfile &essa%es . . . . . . . . F

  Sele#t eneral Key!rs

 ;in$o= recor$ . . . . . . . . . . . . . H SEN;LT

 Tye c"oices ress Enter.

  Key=or$ ((es In$icators/

  ;in$o= ara&eters . . . . . . . . . . . . ;INCO; (

  Select ara&eters . . . . . . . . . . . F

  ;in$o= bor$ers . . . . . . . . . . . . . . ;C;BO5CE5 

  Select ara&eters . . . . . . . . . . .

  5e&o'e =in$o=s . . . . . . . . . . . . . . 5:F;C;  User 5estore Cislay . . . . . . . . . . . US55STCS

  Define 3in! *araeters

 5ecor$ . . . H SEN;LT

 Key=or$ . . H ;INCO;

 5eference$ =in$o= . . . . . . . . . . . . Na&e

 *O5*

 ;in$o= $efinition

  Cefa#lt start ositionin% . . . . . . . ((es

  *O5*

  Start line

  ro%ra&*to*syste& fiel$ . . . . . . . Na&e

  Act#al line . . . . . . . . . . . . . 7 *7

  Start osition

a%e G4of

Page 65: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 65/118

AS/400 QUESTION BANK 

  ro%ra&*to*syste& fiel$ . . . . . . . Na&e

  Act#al osition . . . . . . . . . . . 7 *7

  ;in$o= lines . . . . . . . . . . . . . . 0 *7

  ;in$o= osition . . . . . . . . . . . . 40 *7

  :essa%e line . . . . . . . . . . . . . . ( ((es

  5estrict c#rsor to =in$o= . . . . . . . ( ((es

  Sele#t )e#!r Key!rs

 5ecor$ . . . H SEN;LT

 Tye c"oices ress Enter.

  ((es

  9eneral <ey=or$s . . . . . . . . F

  In$icator <ey=or$s . . . . . . . F

  Alication "el . . . . . . . .

  3el <ey=or$s . . . . . . . . . .

  O#t#t <ey=or$s . . . . . . . . .

(+1 1

 (+0$ 0$

  Define eneral Key!rs

 S#bfile control recor$ . . . . . . . . . H SEN;LT Tye c"oices ress Enter. Key=or$

  5elate$ s#bfile recor$ . . . . . . . S,L8TL SEN;NC Na&e

  S#bfile c#rsor relati'e recor$ . . . S,L8S555N Na&e

  S#bfile &o$e . . . . . . . . . . . . S,L:OCE Na&e

  ((es In$icators/

  Cislay s#bfile recor$s . . . . . . S,LCS F ,

  Cislay control recor$ . . . . . . . S,LCS8TL F

  Initiali)e s#bfile fiel$s . . . . . S,LINJ

  Celete s#bfile area . . . . . . . . S,LCLT

  8lear s#bfile recor$s . . . . . . . S,L8L5 <

  In$icate &ore recor$s . . . . . . . S,LENC $0

  S,LENC ara&eter . . . . . . . . !:O5E F

  S,LENC ara&eter . . . . . . . . !S85BA5 !:O5E ...

a%e Gof

Page 66: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 66/118

AS/400 QUESTION BANK 

  5ecor$ not acti'e . . . . . . . . . S,L5NA

  :ore...

 ,Eit ,78ancel

  Define Dis&lay Lay!%t

S#bfile control recor$ . . . . . . . . . H SEN;LT

Tye 'al#es ress Enter.

  Key=or$ N#&ber 

  5ecor$s in s#bfile . . . . . . . . . . S,LSIJ

  ro%ra&*to*syste& fiel$ . . . . . .

  5ecor$s er $islay . . . . . . . . . S,LA9 ,

  Saces bet=een recor$s . . . . . . . . S,LLIN

OUTUT

  E:LO(EE CETAILS

 .SELE8T

 OT E:NU:BE5 NA:E

  0000 K.SENT3ILKU:A5 

  00007 5.S3(A:SUNCA5 

  0000 B.:O3AN

  00004 K.KU:A5 

  0000 A.A5UL  :ore...

 

E:LO(EE CETAILSH

.SELE8T

OT E:NU:BE5 NA:E

0000G BALU

0000 SENT3IL

0000 5A?

0000 3E:A

0000 FEL

:ore...

a%e GGof

Page 67: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 67/118

AS/400 QUESTION BANK 

 

E:LO(EE CETAILS

 .SELE8T

 OT E:NU:BE5 NA:E

  000 5A:ES3

  00077 SUC3A

  0007 KANCASA:(

. ILE aanta-es !er )*?

Better call erfor&ance

:o$#larity

:#ltile*lan%#a%e inte%ration

En"ance&ents to t"e ILE co&ilers

5e#sable co&onents

8ontrol o'er alication r#n*ti&e en'iron&ent

8o$e oti&i)ation

Tool a'ailability

,o#n$ation for t"e f#t#re

2. 3'at is a 8!%le?

 A &o$#le is a non*eec#table ro%ra& an$ it contains one or &ore roce$#res. If 

yo# "a'e &o$#les =it"o#t roce$#re t"en it &eans t"at it is "a'in% only one $efa#lt

 roce$#re an$ in case =e can #se 8ALLB. ;e are creatin% a 59LE &o$#le by

85T59:OC an$ a 8L &o$#le by 85T8L:OC co&&an$s.

<.! t! t'e #reate !%le?

  A &o$#le is create$ as a searate object tye 1!:OCULE2. Usin% t"e

85T59:OC co&&an$ creates an 59LE &o$#le. A &o$#le object cannot be r#n$irectly. (o# &#st #se t"e 85T9: co&&an$ to bin$ &o$#le object into a ro%ra&

object. ,irst otion or 85T59:OC co&&an$ to create a &o$#le. T"e 85T9:

co&&an$ is #se$ to cerate a ro%ra& fro& one or &ore &o$#le.

SKANCASA:O/59ILE

:AIN

a%e Gof

Page 68: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 68/118

AS/400 QUESTION BANK 

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 8 8ALLB RACCR

0007.00 8 8ALLB RSUBR

000.00 8 8ALLB R:ULR

0004.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SKANCASA:O/59ILE

ACC

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0007.00 8 J*ACC 4 A 4 0

0007.0 8 J*ACC B 4 0

0004.00 8 A ACC B 8 4 0

000.00 8 8 CSL(

000G.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SKANCASA:O/59ILE

SUB

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

007.00 8 J*ACC 0 A 4 0

007.0 8 J*ACC B 4 0004.00 8 A SUB B 8 4 0

00.00 8 8 CSL(

00G.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SKANCASA:O/59ILE

  :UL

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0007.00 8 J*ACC 0 A 4 0

0007.0 8 J*ACC B 4 0

0004.00 8 A :ULT B 8 4 0

000.00 8 8 CSL(

000G.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

a%e Gof

Page 69: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 69/118

AS/400 QUESTION BANK 

85T9: Ta<e ,4

 ro%ra& . . . . . . . . . . . . P :AIN Na&e

  Library . . . . . . . . . . . P SKANCASA:O Na&e !8U5LIB

 :o$#le . . . . . . . . . . . . . P :AIN Na&e %eneric! !9: !ALL 1E2

  Library . . . . . . . . . . . P SKANCASA:O Na&e !LIBL !8U5LIB...

  P ACC

  P SKANCASA:O

  P SUB

  P SKANCASA:O

  for &ore 'al#es P :UL

  P SKANCASA:O

 Tet R$escritionR . . . . . . . !ENT:OCTT

OUTUT

CSL(

 CSL(

 CSL( 0

>. 3'at is t'e ifferen#e in beteen (ALLG (ALLBG an (ALL*?

(ALL is a $yna&ic call ="ere t"e control =ill be transferre$ ="en t"e ro%ra& iseec#te$. 18ontrol =ill be transfer t"e anot"er ro%ra& 1r#n ti&e2 so it is $yna&ic call2.

;"ere as 8ALLB an$ 8ALL are static calls. A &o$#le is a non*eec#table

 ro%ra& an$ it contains one or &ore roce$#res. If yo# "a'e &o$#les =it"o#t roce$#re

t"en it &eans t"at it is "a'in% only one $efa#lt roce$#re an$ in case =e can #se (ALLB.

A &o$#le is "a'in% &ore t"an one roce$#re t"en =e can %i'e elicitly t"e

 roce$#re na&e to be calle$ in case of (ALL* o#t of t"ese t"ree 8ALL is t"e &ost

efficient one. 1Usin% t"e 8ALLB 8ALL a ro%ra& or &o$#le is bin$ in t"e ro%ra& so it

is static2.

20. 3'at is t'e ifferen#e beteen Bin by al%e an Bin by referen#e?

a%e Gof

Page 70: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 70/118

AS/400 QUESTION BANK 

Bin$ by 'al#e Bin$ by 5eference

3ere t"e entire &o$#les to be bo#n$e$ are

 "ysically coie$ into t"e &ain ro%ra&

object.

In t"is case =e are bin$in% t"e ro%ra&s

 by #sin% ser'ice ro%ra&s ="ic" contain

a reference to t"e &o$#le t"at "as been

calle$ an$ t"e &o$#les are not "ysically coie$ into t"e ro%ra&

object.

T"e ro%ra& =ill be eec#te$ e'en ="en

yo# $elete t"e entire &o$#le t"at "as been

calle$.

T"e ro%ra& =ill not eec#te$ ="en t"e

 bin$ &o$#les are $elete$.

Bin$ by 'al#e is faster t"an bin$ by

reference. 1All t"e &o$#les to be bin$ in

t"e &ain ro%ra& so it is fast2

It is not as faster as bin$ by 'al#e. 1All

t"e &o$#les can-t bin$ t"e &ain ro%ra&

it is refer t"e ointer2

21. Define &ass by al%e an &ass by referen#e?

*ass by referen#e:

ass by reference =e are assin% t"e a$$ress of t"e ara&eters an$ not t"e

act#al 'al#e an$ so t"e c"an%es in t"e calle$ roce$#re =ill affect t"e 'al#e in t"e

callin% ro%ra&s. In O: ro%ra&s =e are #sin% only call by reference.

*ass by al%e:

ass by 'al#e =e are assin% t"e 'al#e of t"e ara&eter c"an%es &a$e to t"e

for&al ar%#&ents in t"e calle$ f#nction "a'e no effect on t"e 'al#es of t"e act#al

ar%#&ents in t"e callin% f#nction it is #se$ in c ro%ra&.

In 59LE =e "a'e t"e otion to ass t"e ara&eter by 'al#e by %i'in% t"e

<ey=or$ ALUE.

2. 3'at are *r!-ra Entry *r!#e%re 5*E*6 an User Entry *r!#e%re 5UE*6?

If =e are bin$in% &any &o$#les to%et"er to for& a ro%ra& t"en =e "a'e to secify

="ic" &o$#le "as to ta<e control first ="en it "as been calle$ an$ t"at &o$#le is calle$ as

*E* for t"at ro%ra&.

User entry roce$#re 5UE*6 is t"e first state&ent t"at ta<es t"e control ="en a

 ro%ra& "as been calle$. ,or ea&le in 8 ro%ra&s &ain 12 =ill be eec#te$ first ="en it

a%e 0of

Page 71: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 71/118

AS/400 QUESTION BANK 

"as been calle$ an$ li<e =ise in 59 t"e state&ent co$e$ in 8 Se =ill ta<e t"e control

first.

2$. Define (!&yb!!9 in )*LE?

It =ill coy a S#bro#tine 1or2 any %ro# of co$es "ysically into t"e ro%ra&

="ic" is coyin% it.

 SKANCASA:O/59ILE

  8O

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0007.00 8 CSL( A 0

0007.0 8 ES5 ACC

0004.00 8 SETON L5 

000.00 8/8O( 59ILE 8O(

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SKANCASA:O/59ILE

 8O(

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0

000.00 8 ACC BE9S5 

0007.00 8 ACC A000.00 8 A CSL(

0004.00 8 ENCS5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL(

24.3'at ill +O) !&#!e ill !?

SKANCASA:O/COLOO

,O5 

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 $i s 0 in)12

0007.00 $n s 0 in)102

a%e of

Page 72: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 72/118

AS/400 QUESTION BANK 

000.00 c for i to n

0004.00 c i $sly

000.00 c en$for 

000G.00 c for in $o=nto

000.00 c i $sly

000.00 c en$for 

000.0!for1IIY40ii02

000.00 c for i by n to 40

000.00 c i $sly

00.00 c en$for 

007.00 c for i to 40 by n

00.00 c i $sly

004.00 c en$for 

00.00 c seton lr 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( CSL( 0

CSL( 7 CSL(

CSL( CSL(

CSL( 4 CSL( CSL( CSL( G

CSL( G CSL(

CSL( CSL( 4

CSL( CSL(

CSL( CSL( 7

CSL( 0 CSL(

CSL( CSL(

CSL( CSL(

CSL( 7 CSL( 7

CSL( CSL(

2,. 3'at are t'e ari!%s sta-es f!r a "!b after it is s%bitte?

a%e 7of

Page 73: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 73/118

AS/400 QUESTION BANK 

?ob D#e#e Acti'e job an$ OUTQ is t"e t"ree sta%es after t"e job "as been

s#b&itte$.

2. 3'at is t'e eC%ialent #!an t! setll *loval in (L?

OSCB, =it" file osition as !start =ill set t"e file to t"e be%innin% 1or2 #sin%

OF5CB, an$ secify t"e <ey fiel$ 'al#e by 55N 'al#e 1or2 by %i'in% !start.

22. ! t! #reate a seri#e &r!-ra an 'at are t'e ste&s in!le in t'is?

T"e ser'ice ro%ra& &eans &ost co&&only #se$ &o$#les are %ro#e$

1bin$in%2 to%et"er to for& it is calle$ ser'ice ro%ra&.

A ser'ice ro%ra& is not bo#n$ to its caller #ntil acti'ation ti&e

;"ile creatin% ser'ice ro%ra& =e can create a bin$er ro%ra& ="ere =e can refer 

t"e &o$#les 1or2 roce$#res 1or2 e'en $ata tyes to be #se$ by t"e ro%ra&. ;"ic" is #sin%

ser'ice ro%ra&.

Aanta-es !f seri#e &r!-ras

T"ey $o not ta<e # a#iliary stora%e sace. T"ere is only one coy for all #sers.

T"ere is only a sin%le coy of t"e rea$*only co$e in &ain stora%e for all #sers in

t"is ser'ice ro%ra&s is t"e sa&e as a ro%ra& t"at yo# call $yna&ically.

Eac" #ser of t"e ser'ice ro%ra& "as an in$een$ent =or< area.

(o# can ass ara&eters to a ser'ice ro%ra&s by #sin% t"e tra$itional ara&eter 

list 1or2 by i&ortin% an$ eortin% 'ariables.

Ser'ice ro%ra&s can be &aintaine$ in$een$ently of t"e ro%ra&s t"at #se t"e

f#nctions. In &ost cases c"an%in% a ser'ice ro%ra&s $oes not ca#se a ro%ra&

#sin% t"e f#nction to be c"an%e$ or re*create$.

Disaanta-es !f seri#e &r!-ras

Ser'ice ro%ra&s are less $esirable for a f#nction yo# &ay or &ay not nee$. T"e

reason is t"at it is slo=er to call a &ain ro%ra& t"at refer to a ser'ice ro%ra&

2<. 3'at is an a#tiati!n -r!%&?

Acti'ation %ro# is t"e bo#n$ary set for si&ilar ro%ra&s. Acti'ation %ro# is also

a stora%e sace in &e&ory.

 

8L "as a OF5CB, co&&an$ an$ calls a 59LE ro%ra&

a%e of

Page 74: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 74/118

AS/400 QUESTION BANK 

59LE ro%ra& erfor&s a rea$ oeration an$ t"e ointer is no= in t"e secon$

 ro%ra& an$ no= call t"e ro%ra&

59LE ro%ra& t"at also $o a rea$ oeration ="ic" =ill rea$ t"e secon$ recor$

Since t"e ointer is in t"e secon$ osition an$ t"en ret#rn to 7 n$  ro%ra& in t"e

abo'e sit#ation ="en t"e control transfer fro&

r$

recor$ since t"e 7

  r$

recor$ isalrea$y rea$ in ro%ra& . B#t =e nee$ to nee$ t"e 7 n$ recor$ accor$in% to t"e

lo%ic b#t t"is is not ossible in any O: ro%ra&s. B#t in 59LE t"ere is a

sol#tion for t"is roble& by %i'in% a co&&on acti'ation %ro# for st an$ 7n$

 ro%ra& an$ "a'e a searate acti'ation %ro# for t"e r$ ro%ra& ="ile creatin%

t"e ro%ra& itself an$ t"is =ill a'oi$ all t"e roble& =e face$ before.

In so&e sit#ation =e =ant to s"are bet=een 7 ro%ra& t"en =e can %i'e t"e

acti'ation %ro# in ! !o" le'el in ="ic" t"e c"an%es in one ro%ra& =ill be

affecte$ in anot"er ro%ra&.

Ty&es !f a#tiati!n -r!%& leels:

HNe: In t"is case e'ery ti&e yo# call t"e ro%ra& an ne= acti'ation

%ro# =ill be create$ ="ic" t"is case =ill not be #se$ &ostly.

H#aller: If =e $on-t <no= t"e tye of t"e ro%ra& t"at is callin% t"en =e

can secify !caller ="ere t"e acti'ation %ro# =ill be t"e sa&e of t"e

 ro%ra& t"at is callin%.

Nae a#tiati!n -r!%&: ;e can %i'e o#r o=n na&e$ for $ifferent

acti'ation %ro#.

2>.3'at are t'e stateents t'at are affe#te by a#tiati!n -r!%&?

OF5CB,

ONCB,

ONQ5(,

ST58:T8TL

CLTOF5 

<0. 3'at are t'e stateentsG 'i#' is n!t %se in (LLE t'at is %se in (L*?

58L5S8 ="ic" is relace$ by 58LA8T95

T,58TL

<1. 3'at is t'e ifferen#e beteen +8TDTA an O*NQ)F+?

a%e 4of

Page 75: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 75/118

AS/400 QUESTION BANK 

+8TDTA O*NQ)F

It =ill sort t"e recor$s seD#entially base$ on

t"e osition of t"e recor$

It =ill sort t"e recor$s base$ on t"e fiel$

'al#es.

 If any c"an%e in t"e attrib#te si)e of a ,

t"en =e "a'e to c"an%e t"e ro%ra&

secification also.

If t"ere is any c"an%e in t"e attrib#te si)e it

=ill not affect t"e ro%ra& secification

also.

,:TCTA is bit faster in rocess t"an

ONQ5(,.

ONQ5(, is slo=er as co&are to

,:TCTA if =e are rocessin% &illions of 

recor$s.

<.3'at is t'e ne nae f!r AS/400?

I series 400 is t"e ne= na&e %i'en to AS/400 by IB: no=.

<$.! t! see s!%r#e !f #!&yb!!9s in#l%e in a &r!-ra 'ile #!&ilin- !r

eb%--in-?

;"ile co&ilin% t"e ro%ra& %i'e !list instea$ of !so#rce ="ic" =ill

ean$ all t"e coyboo<s.

<4. E7&lain inner "!in !r nat%ral "!in an left !%ter "!in?

Inner "!in

Inner join &eans t"e &atc"in% recor$s in bet=een t"e joinin% file =ill be

selecte$.

8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP ?,0 ,:T ,

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 ?5E8

0007.00 E:NO S 0000.00 E:NA:E 70A

0004.00 K E:NO

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP ?,07

 ,:T ,.  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 ?75E8

0007.00 E:NO S 0

000.00 E:SAL 0 70004.00 K E:NO

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

a%e of

Page 76: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 76/118

AS/400 QUESTION BANK 

  Cislay 5eort

  E8*NO E8*NA8E

 00000 00 S3(A:BABU

 000007 007 SENT3ILKU:A5  00000 00 5A:ES3

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

  E8*NO E8*SAL

00000 00 00.00

000007 007 70.00

00000 004 00.00!!!!!! !!!!!!!! En$ of reort !!!!!!!!

8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP ?O,ILE

 ,:T L,.  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!

000.00 5 ?5E8 ?,ILE 1?,0 ?,072

0007.00 ? ?OIN 1 72000.00 ?,LC 1E:NO E:NO2

0004.00 E:NO ?5E, 1?,02000.00 E:NA:E000G.00 E:SAL

000.00 K E:NO

  !!!!!!!!!!!!!!!!!! En$ of $ata!!!!!!!!!!!!!!!!!!!!!

 

E8*NO E8*NA8E E8*SAL

 00000 00 S3(A:BABU 00.00

 000007 007 SENT3ILKU:A5 70.00 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

Left !%ter "!in

Left o#ter join all t"e recor$s fro& ri&ary file an$ &atc"in% recor$s fro&

t"e secon$ary file =ill be selecte$.

8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP ?OOUT

 ,:T L,.

!!!!!!!!!!!!!!! Be%innin% of $ata!!!!!!!!!!!!!!!!!!!!!

000.00 =D+TAL

0007.00 5 ?5E8 ?,ILE 1?,0 ?,072

000.00 ? ?OIN 1 720004.00 ?,LC 1E:NO E:NO2000.00 E:NO ?5E, 1?,02

000G.00 E:NA:E

000.00 E:SAL000.00 K E:NO

  !!!!!!!!!!!!!!!!!! En$ of $ata!!!!!!!!!!!!!!!!!!!!

 

a%e Gof

Page 77: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 77/118

AS/400 QUESTION BANK 

  E8*NO E8*NA8E E8*SAL

 00000 00 S3(A:BABU 00.00

 000007 007 SENT3ILKU:A5 70.00

 00000 00 5A:ES3 .00

 HHHHHH HHHHHHHH En !f re&!rt HHHHHHHH

SEQUEN(IN DU*LI(ATE )E(O)DS

8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP SEQ

 ,:T ,.

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!

000.00 5 SEQ5E80007.00 E:NO 0

000.00 E:NA:E 70A

0004.00 ACC5ESS 70A000.00 K E:NO

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!8ol#&ns . . . E$it KSENT3ILS/EA:LE SEUP SEQ7

 ,:T ,

!!!!!!!!!!!!!!! Be%innin% of $ata!!!!!!!!!!!!!!!!

000.00 5 SEQ5E870007.00 E:NO 0

000.00 E:NA:E 70A

0004.00 TEL 0 0  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!

 

E8*NO E8*NA8E1 ADD)ESS 00000 000 BOB 7OLC :ACI;ALA

 000007 0007 CANN( 0LON9 ISLANC

 00000 000 5IN8 0ATTU5 

 !!!!!! !!!!!!!! En$ of reort !!!!!!!! 

E8*NO E8*NA8E TEL

 00000 000 BOB 7 000007 000 BOB 7

 00000 000 BOB 7

 000004 0007 CANN( 4777G00

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP ?C,TSEQ ,:T L,

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!

000.00 5 5E8SEQ ?,ILE 1SEQ SEQ72

0007.00 ? ?OIN 1 72000.00 ?,LC 1E:NA:E E:NA:E2

0004.00 ?CUSEQ 1TEL2

a%e of

Page 78: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 78/118

AS/400 QUESTION BANK 

000.00 E:NO ?5E, 172000G.00 E:NA:E

000.00 ACC5ESS

000.00 TEL  !!!!!!!!!!!!!!!!!! En$ of $ata!!!!!!!!!!!!!!!!!!!!!!!!

  E8*NO E8*NA8E1 ADD)ESS TEL

 00000 000 BOB 7OLC :ACI;ALA 7 000007 000 BOB 7OLC :ACI;ALA 7

 00000 000 BOB 7OLC :ACI;ALA 7

 000004 0007 CANN( 0LON9 ISLANC 4777G00 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

=OIN DES(END

8ol#&ns . . . E$it KSENT3ILS/EA:LE

 SEUP ?C,TSEQ ,:T L,

!!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!

000.00 5 5E8SEQ ?,ILE 1SEQ SEQ72

0007.00 ? ?OIN 1 72

000.00 ?,LC 1E:NA:E E:NA:E20004.00 ?CUSEQ 1TEL !CES8ENC2

000.00 E:NO ?5E, 172

000G.00 E:NA:E000.00 ACC5ESS

000.00 TEL

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!  E8*NO E8*NA8E1 ADD)ESS TEL

 00000 000 BOB 7OLC :ACI;ALA 7

 000007 000 BOB 7OLC :ACI;ALA 7

 00000 000 BOB 7OLC :ACI;ALA 7 000004 0007 CANN( 0LON9 ISLANC 4777G00

 !!!!!! !!!!!!!! En$ of reort !!!!!!!!

<,. E7&lain B%il in f%n#ti!n in ILE?

SUBST 1Strin% na&eH Strin% ositionH len%t"2

ABS 1Absol#te 'al#e by o&ittin% si%n2

EDIT( 1strin%H +-2

 In a alication if =e =ant to concatenate a strin% =it" a n#&eric t"en =e

can #se t"is ECIT8

Ea&leH

SKANCASA:O/BULIC

a%e of

Page 79: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 79/118

AS/400 QUESTION BANK 

  ECIT8

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 $a s 0a in)1Rs"ya&R2

0007.00 $b s 0 0 in)1702

000.00 $c s 0a in)1Rs#n$arR2

0004.00 $$ s 0s 0 in)172

000.00 $e s 0a in)1Rra&bab#R2

000G.00 $o#t s 0a

000.00 c e'al o#tae$itc1bHRR2ce$itc1$HRR2e

000.00 c o#t $sly

000.00 c seton lr 

00.00

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( s"ya& 0000000070s#n$ar 000000007ra&bab#

)E*LA(E 15elacin% strin% act#al strin% startin% osition offset2

3ere =e are relacin% Sent'il9%ar  fro& osition 4 to by 9%. T"e

o#t#t =ill be sen9%l9%ar.

SKANCASA:O/BULIC

  5ELA8E

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 $!relace t"e strin% #sin% <ey=or$ relace

000.00 $c s Ga in)1Rsent"il<#&arR2

0007.00 $b s 70a

000.00 c e'al brelace1R<#&RHcH4H2

0004.00 c b $sly

000.00 c seton lr 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( sen<#&l<#&ar 

a%e of

Page 80: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 80/118

AS/400 QUESTION BANK 

T)I8 1T5I:L T5I:52

T"e #se of t"e T5I: f#nctions is 'ery li&ite$ in t"at t"ey s#ort only t"e #se of 

c"aracter 'ariables an$ $ata str#ct#res. N#&eric fiel$s an$ )ero*fill 'al#es are not

s#orte$. T"ey $o "o=e'er ro'i$e so&e #sef#l f#nction for strin% "an$lin%. ,or 

ea&le in 59 IF one line of co$e is all t"atRs nee$e$ to left*a$j#st a 'al#e =it"in a

fiel$. ,or ea&leH

.....885n0,actorO8o$e1e2,actor75es#ltLen

Cc3iLoED

(  E7+t(%st8aint

  ( Eal  (%stNaeTriL5(%stNae6

Tyically t"e T5I: f#nction is t"e only one of t"e t"ree t"at %et #se$. T"e ot"er 

t=o "o=e'er $o "a'e t"eir lace.

T5I: re&o'es trailin% an$ lea$in% blan<s fro& a fiel$ an$ ret#rns t"e re&ainin%

'al#e in lace =it"in t"e eression. T"e ret#rne$ 'al#e is treate$ si&ilar to a constant

'al#e =it" lea$in% or trailin% blan<s.

T5I:L re&o'es lea$in% blan<s 1tri&*left2 fro& a fiel$ an$ ret#rns t"e 'al#e in

 lace =it"in t"e eression.

T5I:5 re&o'es trailin% blan<s 1tri&*ri%"t2 fro& a fiel$ an$ ret#rns t"e 'al#e in

 lace =it"in t"e eression.

+OUNDG EO+G EQUALGO*EN

OS/400 Fersion 4 5elease 7 59 IF s#orts t"e eli&ination of t"e 5es#ltin%

In$icators. In t"eir lace se'eral ne= b#ilt*in f#nctions "a'e been intro$#ce$. :ost of 

t"ese ne= b#ilt*in f#nction ro'i$e infor&ation abo#t t"e res#lt of ,ile oerations si&ilar 

to t"e 5es#lt in$icators. B#t instea$ of co$in% 5es#ltin% in$icator for ea&le to c"ec< 

for t"e en$*of*file con$ition yo# si&ly c"ec< t"e 'al#e of t"e EO, b#ilt*in f#nction.

T"e b#ilt*in f#nctions t"at relace t"e 5es#ltin% In$icators incl#$eH

a%e 0of

Page 81: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 81/118

AS/400 QUESTION BANK 

,OUNC EO, EQUAL. In a$$ition t"ere are OEN STATUS an$

E55O5. :ysterio#sly &issin% is LO8K to c"ec< for a recor$ loc< con$ition.

+OUND ret#rns an !ON or !O,, con$ition if t"e re'io#s ,ile oeration ret#rns

a recor$*fo#n$ con$ition. T"is is artic#larly #sef#l on t"e 83AIN oeration. 5eali)e

"o=e'er t"at ="en 83AIN sets on 5es#ltin% in$icator a not*fo#n$ con$ition is

si%nale$. ;"ereas =it"o#t co$in% 5es#ltin% In$icator t"e ,OUNC b#ilt*in f#nction

ret#rns t"e fo#nd  con$ition.

EO+  can be #se$ to c"ec< for en$*of file be%innin% of file or s#bfile f#ll

con$itions. A 5EAC an$ 5EACE ret#rn EO,!ON if t"e en$ of file is reac"e$. 5EAC

an$ 5EACE ret#rn EO,!ON if t"e be%innin% of file is reac"e$. T"e ;5ITE oeration

ret#rns EO,!ON if t"e ;5ITE oeration to a s#bfile $etail recor$ ret#rne$ a s#bfile*

f#ll con$ition.

EQUAL is #se$ by t"e SETLL oeration to in$icate t"at it $etecte$ a recor$ in

t"e file =it" a <ey eD#al to t"at of t"e 'al#e secifie$ in ,actor . Since SETLL $oes not

rea$ t"e recor$ $oes not loc< t"e recor$ an$ $oes not coy t"e $ata into t"e in#t b#ffer

SETLL is &#c" faster an$ less of an i&act on t"e erfor&ance of t"e alication t"an

ot"er oerations s#c" as 83AIN. Use 83AIN ="en yo# nee$ to retrie'e t"e recor$ #se

SETLL an$ EQUAL ="en yo# nee$ to only c"ec< for t"e eistence of a recor$.

O*EN is #se$ to c"ec< to see if a file "as alrea$y been oene$. T"e b#ilt*in

f#nction ret#rns !ON if t"e file is oene$ ot"er=ise it ret#rns !O,,.

ELE8

ELE: =ill $islay t"e array $i&ension

ELE:

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 $arr s s 0 $i&1002

0007.00 $c s s 0

000.00 c e'al cele&1arr2

0004.00 c c $sly

000.00 c seton lr 

a%e of

Page 82: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 82/118

AS/400 QUESTION BANK 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( 00

SIME

SIJE =ill $islay t"e si)e of t"e 'ariable

SKANCASA:O/BULIC

SIJE

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 C!B( USIN9 T3IS 8O::ANC ,INC SIJE O, CATA FALUE

000.00 $arr s 0 0 $i&102

0007.00 $$s s 0 0 $i&1702

000.00 $n#& s 70 0

0004.00 c )*a$$ 7 a 70 0

000.00 c &o'el Rsent"ilR b 0

000G.00 c e'al n#&si)e1a2

000.00 c

000.00 c n#& $sly

000.00 c e'al n#&si)e1b2

000.00 c n#& $sly

00.00 c e'al n#&si)e1arr2

007.00 c n#& $sly

00.00 c e'al n#&si)e1arrH!all2

004.00 c n#& $sly

00.00 c e'al n#&si)e1$s2

00G.00 c n#& $sly

00.00 c e'al n#&si)e1$sH!all2

00.00 c n#& $sly

00.00 c seton lr 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTUT

CSL( G

CSL(

CSL( 0

a%e 7of

Page 83: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 83/118

AS/400 QUESTION BANK 

CSL( G

CSL( G0

CSL( G

CSL( 70

EDIT3

<.E7&lain 9ey!r in ILE?

O'erlay

5ena&e

refi

Otions

8onst

<2.! y!% #an s#'e%le a "!b t! r%n &eri!i#ally?

;e "a'e to create a job sc"e$#ler for r#nnin% a job erio$ically. 3ere =e can &a<e

a job to r#n once or erio$ically at a %i'en $ate an$ ti&e. ;e can create a job sc"e$#ler by

#sin% ACC?OBS8CE co&&an$.

;e can list all t"e job sc"e$#ler r#nnin% by #sin% t"e co&&an$ ;5K?OBS8CE

co&&an$ an$ =e can $elete a job sc"e$#ler by #sin% 5:F?OBS8CE or =e can

resc"e$#le t"e job by #sin% 839?OBS8CE.

<<.! t! eb%- a bat#' "!b?

3ol$ t"e batc" job to be $eb#%%e$ by #sin% ;5KA8T?OB co&&an$ an$ "a'in%

otion . Set t"e ointer in t"e batc" ro%ra& to be $eb#%%e$ by #sin% ST5CB9 an$ call

t"e ST5S5F?OB co&&an$ an$ start t"e ser'ice ro%ra& ="ic" =ill enter into t"e $eb#%

&o$e. After enterin% into $eb#% &o$e release t"e job t"at is "ol$ before.

<>.Define KLIST?

KLIST oeration is a $eclarati'e oeration t"at %i'es a na&e to list of K,LC. T"is

KLIST can be #se$ as a searc" ar%#&ent to retrie'e recor$s fro& files t"at "a'e a

co&osite <ey.

>0.Define *LIST?

a%e of

Page 84: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 84/118

AS/400 QUESTION BANK 

T"e $eclarati'e LIST oeration $efines sy&bolic na&e for a ara&eter list to be

secifie$ in a 8ALL oeration.

>1.Define #!&!site 9ey?

It is a <ey for a file ="ic" is co&ose$ of &ore t"an one fiel$.

>.E7&lain &r!#e%re %se in )*LE?

  A roce$#re is a non*eec#table ro%ra&. If a &o$#le is "a'in% &ore t"an one

 roce$#re t"en =e can %i'e elicitly t"e roce$#re na&e to be calle$ in case of 8ALL.

Definin- t'e &r!t!ty&e:

rototye =ill secify t"e follo=in% t"in%s

ara&eter tye

SeD#ence of t"e ara&eter 

5et#rn 'ariable an$ its tye

It tells t"e na&e of t"e roce$#re an$ also t"e tye of t"e call.

It =ill a'oi$ all t"e r#n ti&e roble&s li<e ara&eter &is&atc" by

secifyin% t"e rototye.

*r!t!ty&e interfa#e

It is li<e !entry ara&eter ="ere =e =ill secify t"e ara&eters t"at are

recei'e$ in t"is ro%ra&.

I&!rt an e7&!rt

If yo# =ant to secify t"e roce$#res to be t"e eternal ro%ra&s t"en

=e can secify EO5T in yo#r roce$#re.

l!bal an l!#al ariables

If yo# $eclare a 'ariable in &ain roce$#re t"en it =ill be accessible in

all s#b roce$#re an$ t"is is %lobal $eclaration an$ if yo# secify t"e

$eclaration in t"e s#b roce$#res t"en it =ill not be accesse$ in ot"er 

 roce$#res or in t"e &ain roce$#re.

)et%rn

If =e secify ret#rn in t"e s#b roce$#re t"en it &eans t"at =e are

ret#rnin% so&et"in% to t"e callin% ro%ra&. ;e can ret#rn a &ai&#& of only

one 'ariable to t"e callin% ro%ra&.

a%e 4of

Page 85: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 85/118

AS/400 QUESTION BANK 

)e#%rsi!n

A roce$#re callin% to it self is <no=n as rec#rsion.

*ass by al%e/&ass by referen#e

In case of ass by reference =e are assin% t"e a$$ress of t"e

 ara&eters an$ not t"e act#al 'al#e an$ so t"e c"an%es in t"e calle$ roce$#re=ill affect t"e 'al#e in t"e callin% ro%ra&. In O: ro%ra& =e are #sin% only

call by reference an$ in 59LE =e "a'e t"e otion to ass t"e ara&eter by

%i'in% t"e <ey=or$ FALUE.

(ALL*/E7&ressi!n

;e can call t"e roce$#re by #sin% 8ALL co&&an$ if it is not "a'in%

any ret#rn tye an$ by an eression if it ret#rns any 'al#e.

>$.! y!% #an i&!rt an e7&!rt a ata ty&e beteen &r!-ras?

If yo# are #sin% an eort state&ent ="en $eclarin% a 'ariable t"en t"e $ata tye

can be i&orte$ in any &o$#les t"at is bin$ eit"er by 'al#e or by reference. So in t"is case

=e can ass 'al#es in bet=een &o$#les instea$ of #sin% LIST an$ !ENT5(.

>4. 8essa-e s%bfile re#!r f!rat 9ey!rs?

S,L:S958C 1s#bfile &essa%e recor$2

T"is <ey=or$ is #se$ to %i'e t"e line n#&ber to %et t"e first &essa%e in

t"e $islay.

S,L:S9KE( 1s#bfile &essa%e <ey2

T"is <ey=or$ is #se$ to secify t"at t"e ro%ra& &essa%e D#e#e is b#ilt

one at a ti&e.

S,L9:Q 1s#bfile ro%ra& D#e#e2

It is a &essa%e D#e#e create$ for e'ery ro%ra& acti'e in t"e call

stac<.

T"is <ey=or$ is #se$ to secify t"e fiel$ t"at can "a'e t"e na&e of 

t"e ro%ra& &essa%e D#e#e.

>,. ! t! #reate 8essa-e s%bfile?

(reate essa-e s%bfile

85T:S9, :KS,ILE/LIB

;5K:S9, ,ILE/AN:E

a%e of

Page 86: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 86/118

AS/400 QUESTION BANK 

O*TION 1

  A$$ :essa%e Cescrition 1ACC:S9C2

 Tye c"oices ress Enter.

 :essa%e i$entifier . . . . . . . 8KS0001  Na&e

 :essa%e file . . . . . . . . . . P :KS,ILE Na&e

  Library . . . . . . . . . . . P SKANCASA:O Na&e !LIBL !8U5LIB

 ,irst*le'el &essa%e tet . . . . E:LO(EE NU:BE5 1 8ANNOT BE JE5OS

A9E CO;N

:essa%e $ata fiel$s for&atsH

  Cata tye . . . . . . . . . . H(A)   !NONE !QTC83A5 !83A5...

  Len%t" . . . . . . . . . . . . 10  N#&ber !FA5(

3)K8S+

  :KS000 0 E:LO(EE NU:BE5 8ANNOT BE JE5OS

  :KS0007 0 E:LO(EE V NU:BE5 AI5EAC( EIST

  :KS000 0 E:LO(EE NA:E 8ANNOT BE BLANKS

  :KS0004 0 ACC5ESS12 8ANNOT BE BLANKS

  :KS000 0 8IT( 8ANNOT BE BLANKS

  :KS000G 0 :A5ITAL STATUS ;ILL BE ;IT3 1:/S2

  :KS000 0 E:LO(EE NU:BE5 V ACCEC SU88ES,ULL(  :KS000 0 E:LO(EE NU:BE5 COES NOT EISTS

  :KS000 0 E:LO(EE UCATEC SU88ESS,ULL(

  :KS000 0 E:LO(EE NU:BE5CELETE SU88ES,ULL(

(reate essa-e s%bfile

  0 8S)E(1 S,L:S9 0G/7/07

  70 8S(TL1  S,L8TL :S95E8 0G/7/07

USIN9 SELETION

  Select S#bfile Key=or$s

 S#bfile recor$ . . . . . . . H :S95E8

 Tye c"oices ress Enter 

  ((es

  9eneral <ey=or$s . . . . . . . . F

  In$icator <ey=or$s . . . . . . . F

a%e Gof

Page 87: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 87/118

AS/400 QUESTION BANK 

  :essa%e recor$ . . . . . . . . . F

  TET <ey=or$ . . . . . . . . . .

  Define 8essa-e )e#!r

 S#bfile recor$ . . . . . . . H :S95E8

 Tye c"oices ress Enter.

  Key=or$

  Line n#&ber for first &essa%e . . . . S,L:S958C 4 *7

  :essa%e IC fiel$ . . . . . . . . . . S,L:S9KE( DU88F  Na&e

  1if ro%ra& &essa%e D#e#e is b#ilt

  one &essa%e at a ti&e2

  ro%ra& &essa%e D#e#e fiel$ . . . . . S,L9:Q QUEUE  Na&e

  9enerate a 7G byte fiel$ . . . . . ((es

8ESSAE SUB+ILE 5S+T(TL6

S#bfile control recor$ . . . . . . . . . H :S98TL

 Tye c"oices ress Enter.

  ((es

  9eneral <ey=or$s . . . . . . . . F

  S#bfile $islay layo#t . . . . . F

  S#bfile &essa%es . . . . . . . . F

  Select recor$ <ey=or$s . . . . . F  TET <ey=or$ . . . . . . . . . .

  Define eneral Key!rs

 S#bfile control recor$ . . . . . . . . . H :S98TL

 Tye c"oices ress Enter. Key=or$

  5elate$ s#bfile recor$ . . . . . . . S,L8TL 8S)E(1  Na&e

  S#bfile c#rsor relati'e recor$ . . . S,L8S555N Na&e

  S#bfile &o$e . . . . . . . . . . . . S,L:OCE Na&e

  ro%ra& &essa%e D#e#e fiel$ . . . . S,L9:Q QUEUE  Na&e

  9enerate a 7G byte fiel$ . . . . ((es

  ((es In$icators/

  Cislay s#bfile recor$s . . . . . . S,LCS F

  Cislay control recor$ . . . . . . . S,LCS8TL F

  Initiali)e s#bfile fiel$s . . . . . S,LINJ F

a%e of

Page 88: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 88/118

AS/400 QUESTION BANK 

  Celete s#bfile area . . . . . . . . S,LCLT

  8lear s#bfile recor$s . . . . . . . S,L8L5 

  In$icate &ore recor$s . . . . . . . S,LENC

  S,LENC ara&eter . . . . . . . . !:O5E

  S,LENC ara&eter . . . . . . . . !S85BA5 !:O5E ...

  5ecor$ not acti'e . . . . . . . . . S,L5NA

  :ore...

 ,Eit ,78ancel

  Sele#t )e#!r Key!rs

 5ecor$ . . . H :S98TL

 Tye c"oices ress Enter.

  ((es

  9eneral <ey=or$s . . . . . . . . F

  In$icator <ey=or$s . . . . . . . F

O'erlay <ey=or$s . . . . . . . . F

  Sele#t Oerlay Key!rs

 5ecor$ . . . H :S98TL

 Tye c"oices ress Enter.

  Key=or$ ((es In$icators/ 5oll  O'erlay =it"o#t erasin% . . . . . . OFE5LA( F

(reate (L &r!-ra f!r SND*88S

SKANCASA:O/E:8USTO5 

:S9

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 9: A5:1V:S9IC V:S9,I V:S9CTA2

0007.00 C8L FA51V:S9IC2 T(E1!83A52 LEN12

000.00 C8L FA51V:S9,I2 T(E1!83A52 LEN12

0004.00 C8L FA51V:S9CTA2 T(E1!83A52 LEN102

000.00 SNC9::S9 :S9IC1V:S9IC2 :S9,1V:S9,I2

:S9CTA1V:S9CTA2

000G.00 ENC9:

  !!!!!!!!!!!!!!!!!! En$ of $ata!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

a%e of

Page 89: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 89/118

AS/400 QUESTION BANK 

(reate (L &r!-ra f!r )88S

SKANCASA:O/E:8USTO5 

5:O

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 5:F:S9 9:Q1!5F2 8LEA51!ALL2

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Desi-n t'e s#reen

enerate )* &r!-ra

0000.0 ,:ESSTAB I, A E K CISK 

000.00 ,:KSS85 8, E ;O5KSTN

000.0 8 :OFEL :STATUS S

0007.07 8 :OFEL R!R QUEUE

000.00 8 :OFEL R:KS,ILER :S9,I

0004.00 8 L0 LIST

000.00 8 A5: :S9IC

000G.00 8 A5: :S9,I 0

000.00 8 A5: :S9CTA 0

000.00 8 CO; !IN0!O,,

000.0 8 :OFEL 0 E55O5 0

000.07 8 :OFEL 0 E55O5E: 0

007.00 8 ;5ITE :S98TL

00.00 8 E,:T :KSSEN

00.0 8 8ALL R5:OR

004.00 8 I, E:NU:B!JE5OS

004.0 8 :OFEL E55O5 

004.07 8 :OFEL E55O5E:

00.00 8 :OFEL R:KS000R :S9IC

00G.00 8 :OFEL !JE5OS :S9CTA

00.00 8 8ALL R:S9R L0

00.0 8 ENCI,

>.3'at is a#tie s%bfile?

S#bfile ="ic" are in t"e &ain &e&ory are calle$ as acti'e s#b files.

a%e of

Page 90: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 90/118

AS/400 QUESTION BANK 

A &ai&#& of 7 s#b file can be acti'e at a ti&e.

>2. Nai-ati!n beteen t! s#reens?

SKANCASA:S/TABLES

  E7

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

000.00 ,ECS, 8, E ;O5KSTN

0007.00 8 J*ACC S85 7 0

000.00 8 !IN0 CO;EQ !O,,

0004.00 8 S85 CO;EQ

000.00 8 E,:T CS,

000G.00 8 0 LEAFE

000.00 8 I, !IN0!ON

000.00 8 J*ACC 7 S85

000.00 8 LEAFE

000.00 8 ENCI,

00.00 8 ENCCO

007.00 8 S85 CO;EQ 7

00.00 8 E,:T CS,7

004.00 8 0 LEAFE

00.00 8 I, !IN0!ON

00G.00 8 J*ACC S85

00.00 8 LEAFE

00.00 8 ENCI,

00.00 8 ENCCO

0070.00 8 0 LEAFE

007.00 8 ENCCO

0077.00 8 SETON L5 

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

><. 3'at is t'e ifferent beteen )EADE an (AIN !&#!es?

5EACE 83AIN

.T"e &atc"in% recor$s for table T"e first &atc"in% recor$s only

a%e 0of

Page 91: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 91/118

AS/400 QUESTION BANK 

7. ;e are #sin% t"e looin% concet Looin% is not necessary

.T"e in$icator setin t"e EQ T"e in$icator setin t"e 3I

4. ;e are &ost #sin% in SET9T or SETLL It is not necessary

>>. Define ini#at!r 8OEA?

It is a *bit fla% ="ere 'al#e =ill be eit"er 0 or AS/400 ro'i$er in$icators for 

t"e b#siness #ser.

*74 *Passi%ne$ f#nctions <eys

7* *Po#r o=n #rose

100. Define ITE) / LEAE/DO/D!?

ITE5*P Transfer t"e control before $o loo.

LEAFE*P Transfer t"e control after $o loo.

COU8"ec<s after enterin% t"e loo it is erfor&e$ at least once.

CO; 8"ec<s before enterin% into t"e loo.

101.(L #!ans?

1. 3)K8B)*D8

. ()TS)(*+

By #sin% t"is co&&an$ to create so#rce "ysical file. Cefa#lt , si)e is 7.

.DS*+D

It is #se$ to $islay t"e $etails abo#t t"e file ="en it is create$.

4. DS*++D

It is #se$ for listin% $etails abo#t In$i'i$#al ,iel$s.

,.ST)D+U

It is #se$ to a$$ Cata into t"e recor$s.

.ST)SDA

It is #se$ to %o into screen Cesi%nin% or :en# Cesi%nin%.2.()T8S+

,or creatin% t"e :essa%e file

<.3)K8S+

If yo# =ant to create or c"an%e or $elete any &essa%e =e can #se t"is

co&&an$.

>.()TDTAA)A

a%e of

Page 92: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 92/118

AS/400 QUESTION BANK 

 ,or creatin% T"e Cata Area

10.DS*DTAA)A

,or listin% t"e content of Cata area.

11.(DATA)A

,or c"an%in% t"e content of Cata area.

1.DS*LIBL

 ,or listin% t"e contents of library

1$.ADDLIBLE

,or A$$in% a library into t"e c#rrent library.

14.)8LIBLE

,or 5e&o'in% a library into t"e c#rrent library.

1,.((U)LIB

,or c"an%in% t"e 8#rrent Library to a ne= library

1.EDTLIBL

It is #se$ to t"e e$it of t"e library file. 18"an%e library file it is te&orary

$elete t"e library file2

,or A$$in% or re&o'in% library lists.

12.SNDB)K8S

Use$ for sen$in% &essa%e to all #ser.

1<.()T*+It is #se$ to create a ,. Usin% t"is co&&an$ =e can set t"e &ai&#&

n#&ber of recor$s ="et"er $elete or #$ate oeration is allo=e$ or not &ai&#&

stora%e allocation =aitin% ti&e etc can be $eter&ine$

1>.()TL+

To create t"e lo%ical files.

0.ST))LU

To %o into t"e 5LU =e are #sin% t"is co&&an$. Cefa#lt len%t" of 5LU is

7 if yo# %i'e it an$ creatin% it 'ery first ti&e else it set t"e a%e =i$t" 'al#e of 

last e$ite$ 5LU. ;e can %i'e t"e a%e =i$t" 'al#e fro& to in a%e =i$t"

otion.

1.DS*SBS

It is #se$ to list t"e 'ario#s s#bsyste&s r#nnin% #n$er AS/400 en'iron&ent.

Fario#s s#bsyste&s r#nnin% are QINTE5 QA8TIFE an$ QBAT83 etc.

a%e 7of

Page 93: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 93/118

AS/400 QUESTION BANK 

.()T)**8

It is #se$ to create an 59 ro%ra&. ;e can $eter&ine ="at sort of so#rce

file is %enerate$. ,or ea&le ="en =e nee$ t"e entire so#rce co&ile as it is since

so#rce is $efa#lt. If =e %i'e !NOSOU58E only synta errors is %enerate$

 NOSE8LFL =ill not allo=s secon$ary &essa%e ="ere as ot"er settin% is allo=e$ it

an$ so on

$.()T(L*8

To create 8L ro%ra&

4.EDTOB=AUT

It is #se$ to %i'e a#t"ority to a artic#lar so#rce ,. ,or %i'in% a#t"ority to

ot"er #ser =e &#st %i'e a#t"ority to library #ser rofile an$ t"e so#rce ,.

,.DS*OB=D

If =e <no= library na&e an$ object na&e an$ =e =ant to <no= t"e so#rce

, ="ere it is resi$in% t"en CSOB?C =it" otion as ser'ices instant of basic =ill

%i'e t"e so#rce , na&e.

It $escribes 'ario#s object $escritions li<e create$ Cate 8reate$ by So#rce

"ysical file ="ic" it is bein% create$ an$ so on.

.ST)SQL

To start into SQL.

2.3)KS*L+To =or< =it" Sool file

<.DLTS*L+

To $elete t"e sool file

>.()TDU*OB=

By #sin% t"is co&&an$ to create $#licate object. If yo# =ant to co&ile a

, "a'in% 000 of recor$s an$ ="en =e co&ile it all t"e $ata =ill be lost else if 

yo# =ant to a$$ or $elete a attrib#te $ata for ot"er fiel$s =ill "a'e to coie$. ,or 

t"at =e a $#licate object.

$0.(*F+

5ecor$s are bein% coie$ fro& , to te&orary file an$ after co&ilin% it

=e "a'e to a%ain coy bac< fro& te&orary file to t"e ori%inal file. If =e A$$ a

attrib#te =e "a'e to %i'e !&a an$ if =e =ant to $elete a attrib#te =e "a'e to %i'e

!$ro in t"e &a entry fiel$.

a%e of

Page 94: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 94/118

AS/400 QUESTION BANK 

$1.DLT+

After coyin% into t"e ori%inal file =e "a'e to $elete t"e te&orary file or if 

yo# =ant to $elete any file =e are #sin% t"is co&&an$. CLT, =ill only re&o'e t"e

object

$.)88

It is #se$ to $elete t"e &e&ber as =ell as t"e object.

$$.)UNQ)F

To $islay all t"e recor$s in a ,.

$4.()T(8D

It is t"e o=erf#l co&&an$ #se$ to create #ser $efine co&&an$s.

$,.(8**+8

It is #se$ to co&are t=o ro%ra&s or files. It can be co$e$ by ta<in% otion

4 in S#bfile screen.

$.8)S)(

It is #se$ to &er%e a file =it" anot"er file. ;e "a'e to &ention t"ree files

one is t"e root file ="ic" is j#st a root an$ $oes not contain any co$e e'en. T"e

secon$ file is tar%et file ="ere =e can "a'e t"e rea$y*&a$e =e can coy t"e tar%et

so#rce.

$2.)T(LS)(

If yo# $elete a 8L So#rce t"en =e can retain t"e so#rce if yo# are "a'in% t"eobject by #sin% t"is co&&an$.

$<.SB8=OB

If yo# =ant to s#b&it t"e job in certain inter'al i.e. on a secifie$ $ate an$

ti&e =e can #se t"is co&&an$.

$>.DS*=OB

It =ill $islay all t"e jobs.

40.DS*US)*)+

It =ill $islay all t"e entries re%ar$in% t"e artic#lar #ser rofile. It $islays

infor&ation li<e ="at is t"e #ser. rofile na&e $ate re'io#sly #ser class rintin%

an$ all.

41.(*FS)(+

If =e =ant to coy all t"e &e&bers in a so#rce , to anot"er so#rce ,.

4.3)KA(T=OB

a%e 4of

Page 95: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 95/118

AS/400 QUESTION BANK 

To $islay t"e acti'e jobs r#nnin% in AS/400 syste&s.

4$.DS*=OBLO

By #sin% t"is co&&an$ $islay t"e o#t#t console.

44.SND8S

T"is co&&an$ is to sen$ t"e &essa%e to an #ser.

4,.DS*8S

T"is co&&an$ is $islay all t"e &essa%e.

4.((U)LIB

8"an%e t"e c#rrent library file.

42.ADDLIBLE

It is #se$ to a$$ t"e library. It is f#lly a$&inistrator a#t"ority.

4<.)8LIBLE

T"is co&&an$ is to re&o'e a library fro& t"e list.

4>.()TUS)*)+

It is #se$ to $islay t"e ri%"ts %i'en to a #ser. T"e syste& a$&inistrator can

c"an%e a#t"ority "e can %i'e t"e a#t"ority as a syste& a$&inistrator.

,0.DS*DB) 5ata base relati!n6

T"is is #se$ to list all t"e files ="ic" are relate$ to a ,. It $islays all t"e

L, t"at is referrin% t"e , an$ also lists t"e c"il$ table if it is "a'in% a relation

t"ro#%" ACC,8ST.,1.DS*=OB

It =ill $islay all t"e jobs s#b&itte$ =it"in t"e secific inter'al an$ $islay

t"e entire #ser ="o =or<e$ on t"e syste& at t"at ti&e

,.3)K8SQ

It =ill list all t"e &essa%es of $ifferent #ser in t"e job D#e#e.

,$.(*FS)(+

If =e =ant to coy all t"e &e&bers in a so#rce , to anot"er so#rce , =e

can #se t"is co&&an$.

  ,4.(*FTODKT

If =e =ant to coy fro& so#rce , to a $is<ette file

 

,,.(*FTOTA*

If =e =ant to coy so#rce , to a tae t"en =e can #se t"is co&&an$.

a%e of

Page 96: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 96/118

AS/400 QUESTION BANK 

  ,.ST)DB

If =e =ant to $eb#% a ILE ro%ra& t"en =e can #se t"is co&&an$ .;e "a'e

to create a ILE ro%ra& by co&ilin% =it" ="ic" is 85T59:OC co&&an$

an$ ta<e ,0 %i'e $eb#%%in% 'al#es as !So#rce. T"is =ill create a &o$#le. T"en =e

"a'e t"e create t"e ro%ra& by %i'in% ro%ra& na&e an$ &o$#le na&e as t"e sa&e

an$ if =e are callin% any ot"er &o$#les also in t"at incl#$e t"at in t"e 85T9:

co&&an$

EH 85T9: 9: 1LIB/NA:E2 :OCULE 1LIB/NA:E2

1LIB/SNA:E2

 No= t"e ro%ra& as =ell as t"e &o$#le is create$. T"en =e "a'e to start t"e $eb#%

 by #sin% t"e co&&an$.

  ST5CB9 9: 1LIB/NA:E2 UC5OC 1!(ES2

  It =ill s"oe t"e so#rce co$e of t"e ro%ra& an$ =e "a'e to ress ,G set t"e brea< 

 oint an$ ress ,0 <ey an$ call t"e ro%ra&

  8ALL NA:E

,*P $islay t"e 'ariable

S"ift , *P %o to &o$#le

10. Data ty&es in (L?

('arG L!-i#alG N%eri#al

10$. Strin- !&erati!n in (L?

H(AT *P8oncatenate =it"o#t e$itin%.

HB(AT*PTrailin% blan<s in t"e first c"aracter strin% are tr#ncate$. One blan<s is

inserte$ t"en t"e t=o c"aracter strin%s are concatenate$. Any lea$in% blan<s of t"e

secon$ oeran$ are not tr#ncate$

!T(AT@JAll trailin% blan<s in t"e first c"aracter strin% are tr#ncate$ an$ t"en t"e

t=o c"aracter strin%s are concatenate$. Any lea$in% blan<s of t"e secon$ oeran$

are not tr#ncate$.

a%e Gof

TF*E 56 LEN 56 ALUE 56

!CE8 Cefa#lt 1 2

:a 1 2

Cefa#lt 102

!83A5 Cefa#lt 172 Cefa#lt 1b2

!L9L Cefa#lt 1+0-2

Page 97: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 97/118

AS/400 QUESTION BANK 

SKANCASA:O/8L

  ST5IN9

  !!!!!!!!!!!!!!! Be%innin% of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0000.0 /!ST5IN9 !8AT !B8AT !T8AT ,UN8TION !/

000.00 9: A5:1VST5 VST5 VST57 VST5 VST542

000.07 C8L FA51VST52 T(E1!83A52 LEN12

000.0 C8L FA51VST52 T(E1!83A52 LEN12

000.04 C8L FA51VST572 T(E1!83A52 LEN12

000.0 C8L FA51VST52 T(E1!83A52 LEN12

000.0G C8L FA51VST542 T(E1!83A52 LEN1402

000.0 839FA5 FA51VST572 FALUE1VST5 !8AT VST52

000.0 839FA5 FA51VST52 FALUE1VST5 !B8AT VST52

000.0 839FA5 FA51VST542 FALUE1VST5 !T8AT VST52

000.0 SNC:S9 :S91VST52 TOUS51SKANCASA:(2

000. SNC:S9 :S91VST542 TOUS51SKANCASA:(2

000.7 SNC:S9 :S91VST572 TOUS51SKANCASA:(2

000G.00 ENC9:

  !!!!!!!!!!!!!!!!!! En$ of $ata !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

r%n

call ro%ra& na&e 1strin-6  f4ro%ra& . . . . . . . . . . . . P ST5IN9 Na&e

  Library . . . . . . . . . . . P SKANCASA:O Na&e !LIBL !8U5LIB

 ara&eters . . . . . . . . . . . P SENT3IL

  P <#&ar 

  P RR

  P RR

  for &ore 'al#es P RR

DS*8S

104. ! t! set t'e #%rs!r &!siti!n in &arti#%lar fiel in &arti#%lar &!siti!n?

Usin% t"e #%r&!s

10,. ! ill retriee t'e ata in ata area?

In 6retrie'e a $ata area

O#t*=rite a $ata area

a%e of

Page 98: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 98/118

AS/400 QUESTION BANK 

  10.B%ilt in f%n#ti!n in (L?

SUBST5IN9 or SST

T"e s#b strin% b#ilt*in f#nction ro$#ces a c"aracter strin% t"at is a

s#bset of an eistin% c"aracter strin% an$ can only be #se$ =it" a 8L

 ro%ra&.

SUBST5IN9 18"aracter*'ariable*na&e Startin%*osition len%t"2

  Or 

 SST 18"aracter*'ariable*na&e Startin%*osition len%t"2

S;IT83

10. Define ini#at!r in (L?

;e can set on or setoff t"e in$icator by t"e co&&an$.

839FA5 1VIN02 FALUE 1+0-2 *Psetoff 

839FA5 1VIN02 FALUE 1+-2*Pseton

 

102. 8essa-e s%bfile in (L?

S#bfile cannot be #se$ in 8L b#t =e can #se &essa%e s#bfiles in 8L.

10<. (L &r!#essin- #!ans &r!-ra #!ntr!l #!ans?

5O8ESSIN9 *P 839FA5 SNC9::S9 OF5CB, ANC CLT,.

5O95A: 8ONT5OL *P8ALL 5ETU5N T,58TL

10>. ! t! (L #!e 'as t! #'an-e t! %se a #all &r!#e%re?

By #sin% 8ALL58 co&&an$. T"is is t"e bo#n$ call in 8L t"at calls a

 roce$#re =it"in a &o$#le.

110. +i-%ratie #!nstants in )*LE?

!3IFAL !LOFAL !JE5O !JE5OS !BLANKS SETLL SET9T.

111. )enae !f fiels an &refi7?

11. ! y!% ill a!i %lti&le %sers %&atin- t'e sae re#!rs?

T"e $islayin% t"e recor$s in t"e screen =e =ill be %ettin% t"e ti&esta&

alon% =it" t"e act#al $ata. Store t"is in o#t#t $ata str#ct#re an$ ="ile #$atin% c"ec< 

=eat"er t"e re'io#s ti&e sta& is t"e sa&e ti&esta& before #$atin%. If t"e recor$ is

#$ate$ by anot"er #ser t"an t"e ti&e sta& =ill be c"an%e$ an$ if it $oes not &atc"es

t"en t"ro= t"e error &essa%e +5ecor$ is alrea$y #$ate$ by anot"er #ser- else #$ate

t"e recor$s =it" c#rrent ti&e sta&.

a%e of

Page 99: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 99/118

AS/400 QUESTION BANK 

*r!-ra 1

Store t"e ti&e sta& an$ t"is ti&e sta& =ill co&e as a in#t to t"e secon$ ro%ra&

*r!-ra

3ere =st&st contains t"e in#t ti&e sta& an$ c"ec< t"is &atc"es =it" t"e

$atabase. If &atc"es U$ate else sen$ error &essa%e.

11$.Define biner &r!-ra?

T"e bin$er ro%ra& &eans bin$in% t"e roce$#re it is calle$ bin$er ro%ra&.

114.C%esti!n etails?

DE+AULT (L 8SID?

8,0000

Ds&f in!s ty&e?

;INCO;

! any 9ey efine in l!-i#al file?

All t"e , fiel$s are create in <ey.

3'at is t'e leel #'e#9 err!r?

T"e le'el c"ec< error &eans 59LE ro%ra& is co&ile$ an$ , or 

L, are co&ile s#ose t"e , or L, co&ile after t"e co&ilin% t"e

59LE ro%ra& t"is tye of error is calle$ le'el c"ec< error.

If yo# =ant to coy a , =it"o#t &a<in% any &o$ification to it t"en

,O5:AT <ey=or$ is #se$.

Cefa#lt access at" &aintenance is !I::EC

:ai&#& no of rinter files incl#$e$ in a 59LE ro%ra& is

:ai&#& no of files $eclare$ in 59LE is 0 an$ 8L is l

:ai&#& no of <ey fiel$s incl#$e$ is 70

:ai&#& no of fiel$s incl#$e$ in a , is 000

:ai&#& no of arrays incl#$e$ is a 59 is 700

:ai&#& no of ara&eter asse$ in a 59 is 7 an$ 8L 40

Total no of syste& library is an$ #ser library is 7

;"ile lo%%in% on t"e first library to be incl#$e$ is QS(S

Q93 an$ QTE: are #ser library

rinter file $efa#lt len%t" is 7.

Cefa#lt si)e of a &e&ber is 85TS58, co&&an$ for or$inary files is 7.

a%e of

Page 100: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 100/118

AS/400 QUESTION BANK 

11,. 3'ats t'e ifferen#e beteen (AIN an SETLL? Is t'ere a &erf!ran#e

aanta-e?

T"ere are t=o i&ortant $ifferences bet=een 83AIN an$ SETLL.

. T"e 83AIN oeration alies a recor$ loc< to files t"at are oen or #$ate. T"e

SETLL oeration $oes not aly t"e loc<.

7. T"e 83AIN oeration coies t"e recor$Rs $ata to t"e in#t b#ffer for t"e ro%ra&.

T"e SETLL oeration $oes not.

8!re Details

T"e 83AIN oeration erfor&s a ran$o& 9ET oeration to t"e $atabase file. If t"e

oeration is s#ccessf#l t"e $ata in t"e recor$ is coie$ to t"e in#t b#ffer. If t"e 83AIN

oeration fails a recor$*not*fo#n$ con$ition is si%nale$ tyically 'ia 5es#ltin% In$icator .

If t"e $atabase file "as been oene$ for UCATE t"e 83AIN oeration laces a recor$

loc< on t"e retrie'e$ recor$. No ot"er alication can access t"is recor$ for #$ate ="ile

t"is loc< is alie$. ,#rt"er&ore if anot"er ro%ra& "as iss#e$ a loc< to t"e recor$in%

 bein% accesse$ t"e 83AIN oeration =ill =ait for t"e $atabase ti&e*o#t erio$. If t"e

recor$ is release$ $#rin% t"at erio$ t"e 83AIN oeration contin#es. If t"e ot"er ro%ra&

$oes not release t"e recor$ t"e 83AIN oeration fails =it" an ecetion.

(AIN it' NO LO(K 

T"e 83AIN oeration s#orts t"e NO LO8K oeration eten$er 1t"e ol$ Z"alf*

a$j#stZ col#&n2. In 59 III yo# secify an N in t"e oeration eten$er col#&n in 59 IF

yo# secify 83AIN 1n2 for t"e oeration co$e. Usin% NO LO8K allo=s yo# to access a

recor$ =it"o#t a recor$ loc< bein% alie$ re%ar$less of t"e =ay in ="ic" t"e file is oen.

T"e recor$Rs $ata "o=e'er is still coie$ to t"e in#t b#ffer ="en NO LO8K is secifie$.

T"e SETLL oeration erfor&s a D#asi 5EAC LESS T3AN O5 EQUAL

oeration. If t"e oeration is s#ccessf#l a 5EAC 5IO5 is erfor&e$. T"e $atabase

recor$Rs $ata "o=e'er is not coie$ to t"e in#t b#ffer nor is t"ere a recor$ loc< alie$ to

a%e 00of

Page 101: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 101/118

AS/400 QUESTION BANK 

t"e accesse$ recor$. 3ence SETLL is robably t"e oeration co$e to #se for testin% t"e

eistence of a recor$. 3o=e'er if t"e recor$ nee$s to be retrie'e$ 83AIN &ore effecti'e.

*erf!ran#e

If yo#r reD#ire&ent is to c"ec< for t"e eistence of a recor$ tra$itionally t"e

83AIN oeration is #se$. 3o=e'er since 83AIN coies t"e recor$Rs $ata to yo#r 

 ro%ra&Rs in#t b#ffer t"ere is a$$itional o'er"ea$ reD#ire$ for t"e 83AIN oeration. T"e

SETLL can be #se$ to effecti'ely acco&lis" t"e sa&e tas< as t"e 83AIN test. Use SETLL

=it" res#ltin% in$icator 1eD#al2. If t"is in$icator is set on a recor$ eists ="ose <ey

&atc"es t"ey 'al#e secifie$ in ,actor . If yo#r reD#ire&ent is t"at t"e recor$ e'ent#ally

 be #$ate$ s#bseD#ent to t"e eistents test yo# s"o#l$ consi$er #sin% of 83AIN.

11. ! ! I eb%- a re!te 5i.e. Pbat#'P6 "!b fr! an intera#tie "!b?

T"e ability to $eb#% anot"er job "as been a lon%*stan$in% reD#ire&ent for AS/400

no= iSeries ro%ra&&ers. It isnRt as $iffic#lt as it &ay see&. ;"et"er yo# nee$ to $eb#% a

 batc" job anot"er interacti'e job or an 3TT ser'er job 1bro=ser/89I ro%ra&2 t"e

follo=in% stes can %et yo# starte$.

Startin- Deb%- f!r a )e!te =!b

. Ceter&ine t"e job na&e of n#&ber for t"e job yo# nee$ to $eb#%.

Use ;5KA8T?OB an$ note t"e ?ob na&e n#&ber an$ #ser rofile IC.

If $eb#%%in% a 89I ro%ra& loo< in t"e job lo% of t"e job for 8, &essa%e

3T700.

7. 5#n t"e Start Ser'ice ?ob 1ST5S5F?OB2 co&&an$ secifyin% t"e job to be

$eb#%%e$

E.%. ST5S5F?OB ?OB 1074/#sri$/jobna&e2

. 5#n Start Ceb#% 1ST5CB92 on t"e ro%ra& to be $eb#%%e$

E.%. ST5CB9 9: 1libna&/%&na&e2 UC5OC1!(ES [ !NO2

a%e 0of

Page 102: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 102/118

AS/400 QUESTION BANK 

4. At t"is oint t"e ro%ra& in t"e re&ote job is #n$er $eb#% control fro& yo#r job

(o# can no= set brea< oints 1if yo#Rre $eb#%%in% an 59 IF ro%ra& t"e

so#rce =ill "a'e alrea$y been $islaye$2.

ress ,7 fro& =it"in t"e $eb#%%er to ret#rn to 8:C entry after settin%

yo#r brea< oints.

. E'o<e t"e ro%ra& in t"e re&ote job. If yo# yo#Rre $oin% a =eb bro=ser session "it

t"e SUB:IT b#tton.

G. (o# interacti'e job =ill Zbrea<Z at t"e $eb#% brea< oints an$ yo# can $eb#%

alication nor&ally.

Enin- Deb%- f!r a )e!te =!b

En$in% t"e $eb#% session s"o#l$ be $one in t"e follo=in% seD#ence.

. ,ro& yo#r $eb#%%in% session r#n t"e En$ Ceb#% 1ENCCB92 co&&an$

7. T"en r#n t"e 1En$ Ser'ice ?ob2 ENCS5F?OB co&&an$

(o#r session is no lon%er controllin% t"e re&ote job. T"e re&ote job contin#es nor&ally.

S&e#ial (!nsierati!ns 'en Deb%--in- a 3eb Br!ser/(I *r!-ra

To $eb#% a 89I ro%ra& t"at is e'o<e$ fro& a ;eb Bro=ser session r#nnin% fro& t"e

stan$ar$ IB: 3TT ;eb Ser'er yo# nee$ to $o t"e follo=in% in a$$ition to t"e abo'e.

Bef!re Startin- Deb%- f!r a 3eb Br!ser/(I Sessi!n/*r!-ra

En$ t"e 3TT Ser'er #sin% t"e follo=in% 8L co&&an$H

ENCT8SF5 !3TT

;A5NIN9\\\ ** (o# :UST incl#$e !3TT as t"e ara&eter for 

ENCT8SF5 ot"er=ise all T8/I ser'er jobs 1incl#$in% telnet ft s&t

etc.2 =ill be en$e$. An$ t"is is a ba$ t"in%. IB: s#c<s for &a<in% !ALL t"e

$efa#lt for ENCT8SF5.

5estart t"e 3TT Ser'er #sin% t"e follo=in% 8L co&&an$H

a%e 07of

Page 103: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 103/118

AS/400 QUESTION BANK 

ST5T8SF5 !3TT 3TTSF51CE,AULT R*&inat *&aat R2

T"is restarts t"e 3TT ser'er =it" once instance of eac" job tye 1one for 

89I one for ?a'a etc.2

Usin% ;5KA8T?OB in t"e Q3TTSF5 s#bsyste& location t"e jobs

r#nnin%.

T"e job ="ose joblo% contains t"e 8, &essa%e 3T700 is t"e one to be

$eb#%%e$.

After ,inis"in% t"e Ceb#% Session

En$ t"e 3TT ser'er #sin% t"e follo=in% 8L co&&an$H

ENCT8SF5 !3TT

5estart t"e 3TT ser'er #sin% t"e follo=in% 8L co&&an$ #nless yo#r s"o "as

anot"er rocess for startin% t"e 3TT ser'erH

ST5T8SF5 !3TT

(o#r syste& s"o#l$ be bac< to nor&al.

112. 3'at is t'e ne E !&erati!n e7tener %se f!r?

T"e ne= 1E2 oeration eten$er is #se$ to ca#se t"e E55O5 an$ STATUS

 b#ilt*in f#nctions to be initiali)e$ after an oeration is erfor&e$. T"at is t"ese b#ilt*in

f#nctions an$ t"e E oeration eten$er are #se$ in lace of 5es#ltin% In$icator 7 on all

oeration co$es t"at c#rrently s#ort 5es#ltin% In$icator 7 as an error con$ition.

,or ea&le to c"ec< to see if a recor$ is loc<e$ yo# =o#l$ co$e t"e follo=in%H

.....8S5n0,actorO8o$e1e2,actor75es#ltLen

Cc3iLoED

  8 8#stNO ('ain1E2 8#st:ast

  8 if E55O5   !ON

  8 Select

a%e 0of

Page 104: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 104/118

AS/400 QUESTION BANK 

  8 ;"en STATUS  77

  8 esr U$ateNo5ea$

  8 ;"en STATUS  7

  8 esr 5ec$Loc<e$

  8 en$SL

  8 ELSE

  8 if ,OUNC 18#st:ast2

  8 esr ="ate'er...

  8 en$if 

  8 en$if 

T"e concet is to first c"ec< E55O5 for a %enerali)e$ error con$ition an$ t"en

c"ec< STATUS for t"e secific error. Note t"at no res#ltin% in$icators are #se$ in t"e re'io#s ea&le. T"e nor&al not-fo#nd  con$ition is c"ec<e$ #sin% t"e ,OUNC b#ilt*in

f#nction rat"er t"an testin% 5es#ltin% In$icator .

11<. 3'y !esnt t'e (A) b%ilt@in f%n#ti!n !r9 it' n%eri# al%es?

Un$er t"e initial release of OS/400 Fersion 4 5elease 7 t"e 83A5 b#ilt*in

f#nction =as intro$#ce$. 3o=e'er t"e f#nction as $esi%ne$ only con'erte$ CATE 'al#es

to c"aracter 'al#es. T"is ro'e$ to be too restricti'e a #se for t"is f#nction. In t"e netrelease of OS/400 1F4542 IB: =ill a$$ f#nction to 83A5 allo=in% it to con'ert all

for&s of non*c"aracter $ata to c"aracter. In t"at release 83A5 =ill f#nction =it"

n#&eric 'al#es.

  C A&o#nt * 7 In)17.42

  8 E'al tet RT"e a&o#nt isH R 8"ar1

a&o#nt 2

T"e TET fiel$ =o#l$ contain t"e follo=in% after t"e EFAL oeration is

 erfor&e$H

RT"e a&o#nt isH 7.4R

a%e 04of

Page 105: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 105/118

AS/400 QUESTION BANK 

Unli<e ECIT8 t"e 83A5 b#ilt*in f#nction tri&s off lea$in% blan<s. 3o=e'er

ECIT8 ro'i$es &#c" &ore e$itin% o=er t"an 83A5. Use 83A5 for basic

n#&ber to c"aracter con'ersion.

11>. 3'ats ne in 4)4 an )* I?

T"ere are a fe= si%nificant en"ance&ents in 59 IF in OS/400 Fersion 4 5elease 4.

T"e (A)  b#ilt*in f#nction "as be fie$. It no= f#nctions li<e it =as

s#ose$ to in t"e first lace. (o# can =ra a n#&eric 'al#e in 83A5 an$ a

nicely e$ite$ c"aracter for& of t"e n#&ber is ret#rne$. T"e e$ite$ for& incl#$es t"e

$eci&al tri&&e$ off lea$in% blan<s an$ a ne%ati'e si%n.

T"e +O) l!!& ro'i$es a free*for&at 'ersion of t"e CO oeration co$e.

;it" t"e ,O5 oeration yo# can be%in a loo oeration an$ contin#e iteratin%

t"ro#%" t"e loo #ntil a 'ariable eD#als a li&it 'al#e. T"e synta for t"e ,O5 

oeration is en"ance$ =it" t"e TO B( an$ CO;NTO <ey=or$s. T"e TO oeration

in$icators t"e #er li&it for t"e looin% ="ile t"e B( <ey=or$ i$entifies t"e

incre&ent 'al#e for t"e loo co#nter. Alternati'ely yo# can secify t"e CO;NTO

<ey=or$ to loo bac<=ar$s fro& a lar%e 'al#e to a s&all 'al#e.

T"e O*ENO*T  <ey=or$ is a$$e$ to t"e 3ea$er secification. T"is

<ey=or$ can be #se$ alon% =it" its one an$ only <ey=or$ !INJO,L to ca#se

o'erflo= in$icators to be set off ="en t"eir correson$in% rinter file is close$ an$

t"en re*oene$ $#rin% t"e ro%ra&.

In s#bro#tines t"e LEAES) oeration can no= be #se$ to eit a

s#bro#tine i&&e$iately. Effecti'ely t"is is a Z%lorifie$ %otoZ oeration t"at

 branc"es to t"e ENCS5 state&ent of a s#bro#tine.

10. ! !es t'e (ONST 9ey!r !r9 it' *r!#e%re &araeters?

If yo# are certain t"at t"e calle$ roce$#re =ill NOT &o$ify a ara&eter t"e 8ONST

<ey=or$ can ro'i$e se'eral benefits.

a%e 0of

Page 106: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 106/118

AS/400 QUESTION BANK 

. It a#to&atically con'erts a fiel$ of a si&ilar $ata tye to t"e len%t" an$ tye

reD#ire$ by t"e ara&eter.

;"at t"is &eans is say a ara&eter is a osition ac< fiel$ =it"

$eci&als. Nor&ally yo#R$ "a'e to secify a $<12 fiel$ for t"e ara&eter.

3o=e'er if t"e ara&eter is rea$*only yo# can secify 8ONST on t"e

rototye an$ roce$#re Interface for t"e ara&eter. ;"en yo# $o t"is t"e

co&iler a#to&atically con'erts t"e 'al#e 1say itRs a literal of 72 to t"e si)e an$

tye reD#ire$ by t"e ara&eter. T"is =or<s really cool =it" CATE fiel$s. A $ate

for any for&at can be asse$ as a ara&eter 'al#e ="en t"at ara&eter 'al#e is

8ONST.

7. erfor&ance is i&ro'e$ beca#se t"e co&iler can %enerate &ore oti&i)e$ co$e

for t"e 8ONST ara&eter.

8ONST can be #se$ on calls to roce$#res or ro%ra&s. ;e #se it all t"e ti&e

="en callin% Q8:CE8 fro& =it"in 59 IF. All t"ree ara&eters of t"e Q8:CE8

 ro%ra& are 8ONST 'al#es. T"e ea&le co$e belo= can be #se$ as t"e 5OTOT(E

to call Q8:CE8 fro& =it"in 59 IF. To call it #sin% t"is rototye secify

so&et"in% li<eH (ALL* r%n5alible yLib 146 in yo#r calc#lation secs.

.....CNa&eEUCS.......Len%t"TCc.,#nctions

  C )%n  *)   E7t*-1RQ8:CE8R2

C c&$str 000A  (!nst O&ti!ns1!FarSi)e2

  C c&$len *  (!nst

  C c&$Cbcs A  (!nst O&ti!ns1!NOASS2

N!te:  if yo#Rre #sin% 8o$eSt#$io or IB:Rs 8o$e/400 as yo#r 59 IF e$itor #n$er 

;in$o=s yo# co#l$ si&ly "i%"li%"t t"e abo'e so#rce co$e =it"in yo#r Internet Bro=seran$ coy it to t"e ;in$o=s cliboar$. T"en acti'ate 8o$eSt#$io 1or 8o$e/4002 an$ #se t"e

aste f#nction to insert t"e co$e $irectly into t"e e$itor. retty cool "#"W Y%P

a%e 0Gof

Page 107: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 107/118

AS/400 QUESTION BANK 

11. (an y!% #lear %& t'e #!nf%si!n in t'e ifferent releases !f )* I an OS/400

an ILE?

59 IF is t"e net %eneration of t"e 59 lan%#a%e. 59 III is t"e ori%inal 'ersion

of AS/400 59/400. T"e na&e ZAS/400 59/400Z is t"at %i'en to t"e IB: co&iler 

 ac<a%e for $istrib#tion on t"e AS/400. T"is co&iler ac<a%e co&iles 'ario#s 'ersions

of 59 incl#$in% 59II an$ at least t=o releases of 59III.

As of OS/400 Fersion release IB: c"an%e$ t"e na&e of t"is co&iler ac<a%e

to ZAS/400 ILE 59/400Z. T"e reason for t"is na&e c"an%e =as to i$entify t"at fact t"at

t"e co&ile no= incl#$es a 'ersion of 59 t"at tar%ets t"e Inte%rate$ Lan%#a%e

En'iron&ent 1ILE2 t"at is 59 IF.

ILE =as first s"ie$ in OS/400 Fersion 7 5elease . 3o=e'er only t"e 8

lan%#a%e co&iler ro$#ce$ co$e t"at tar%ete$ t"is en'iron&ent. ,irst a =or$ abo#t ILE.

ILE is t"e ne= Znati'eZ r#nti&e en'iron&ent for ro%ra&s on t"e AS/400. Un$er 

OS/400 Fersion 7 5elease IB: intro$#ce$ a ne= ro%ra& &o$el. T"is basically &eans

t"at ne= feat#res an$ interfaces beca&e a'ailable. 3o=e'er IB: $i$ not j#st ort so&e

r#nti&e en'iron&ent to t"e OS/400 oeratin% syste& it act#ally re*=rote co$e an$ =rote

ne= co$e t"at essentially c"an%e$ t"e =ay OS/400 =or<s. T"is ne= co$e ro'i$es s#ort

for a &ie$ set of "i%"*le'el lan%#a%es.

re'io#sly 59 an$ 8L "a$ t"eir o=n little r#nti&e en'iron&ent 8OBOL "a$ itRs

o=n 8 "a$ itRs o=n an$ so on. Un$er ILE all ro%ra&&in% lan%#a%es r#n in ILE. T"e

sa&e Zen'iron&entZ is #se$ for 8OBOL 8 59 an$ 8L.

3o=e'er to ta<e a$'anta%e of ILE ne= co&ilers nee$e$ to be create$. As for 59

rat"er t"an con'ert t"e eistin% 59II an$ 59III co&ilers IB: ="o =as $esi%nin% a

ne= 'ersion of 59 any=ay $eci$e$ to tar%et ILE =it" t"e ne= co&iler. T"is =o#l$

si&#ltaneo#sly ro'i$e a ne= 'ersion of 59 an$ an ILE tar%ete$ co&iler.

a%e 0of

Page 108: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 108/118

AS/400 QUESTION BANK 

Naes Are I&!rtant

A %oo$ frien$ of &ine once sai$ Zna&es are i&ortantZ in t"e ro%ra&&in% =orl$.

If a fiel$ is calle$ Z5"inocerosZ $oes it reresent its #se or #roseW O<ay so er"as in

tra$itional 59 ZI%#anaZ is a better c"oice for t"is ea&le. 1S"orter na&e.2

C#rin% t"e $e'elo&ent of 59 IF t=o $istinct iss#es arose. ,irst t"e internal

na&e for 59 IF =as ZILE 59Z. T"is =as not a co$e na&e b#t rat"er t"e na&e IB:

#se$ to refer to t"e ne= co&iler. After all it =as tar%etin% ILE ="y not refer to it as ZILE

59ZW Secon$ t"e re*arc"itect#re of 59 ca&e into D#estion.

Unfort#nately t"e internal na&e ZILE 59Z be%an to be lea<e$ o#t to t"e #blic.

Se'eral &a%a)ine =riters an$ IB:ers not in'ol'e$ in t"e $e'elo&ent of 59 IF

contin#e$ to #se t"e ter& ZILE 59Z ="en referrin% to 59 IF. I s#ose t"ese eole

still refer to t"e AS/400 as Silver$a%e or er"as e'en Olypic.

T"en ="en IB: anno#nce$ t"e co&iler ac<a%e or ro$#ct na&e as ZAS/400 ILE

59/400Z it only a$$e$ to t"e conf#sion. IB: $roe$ t"e ball ="en ro&otin% t"e 59

IF na&e. T"ey are after all set # to &ar<et t"eir ro$#cts =it" t"eir ro$#ct na&es. T"e

na&e of one ro%ra&&in% lan%#a%e incl#$e$ in a ro$#ct t"at contains nearly se'en f#ll

co&ilers isnRt "i%" riority.

59 IF is t"e 'ersion of 59 t"at tar%ets ILE. OS/400 F5 co&atible 59 IF can

also tar%et ="at is no= calle$ Zt"e ori%inal ro%ra& &o$elZ or si&ly O:. O: is j#st a

na&e t"at "as been %i'en to t"e ori%inal r#nti&e en'iron&ent of 59 an$ 8L #n$er 

OS/400. T"is is t"e en'iron&ent in ="ic" 59III an$ 8L r#n. Un$er ILE "o=e'er t"e

ori%inal nati'e en'iron&ent is e&#late$ t"at is ILE isnRt an en'iron&ent at all it is native

OS/400 ="ereas O: is no= an en'iron&ent #n$er ILE. So&e 'ery cle'er ro%ra&&in%

an$ $esi%n =ent into t"is $onRt yo# t"in<W Not 'ery &any ot"er oeratin% syste&s if any ro'i$e t"is <in$ of contin#ity.

)* I @@ )elease 'at?

59 IF =as first s"ie$ =it" OS/400 Fersion 5elease . T"is is no= referre$ to

as 59 IF release . B#t $onRt =orry abo#t re&e&berin% releases of 59 IF.

a%e 0of

Page 109: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 109/118

AS/400 QUESTION BANK 

Un$er OS/400 Fersion 5elease G IB: en"ance$ 59 =it" roce$#res &any

&ore b#ilt*in f#nctions an$ se'eral ne= $ata tyes. T"is is referre$ to as 59 IF release 7.

T"en OS/400 Fersion 5elease 7 =as anno#nce$. It bro#%"t t"e ori%inal release

of 59 IF 1on t"e 8IS8 boes2 # to t"e sa&e le'el as 59 IF #n$er F5G. Are yo#

conf#se$ yetW :e too\

Un$er OS/400 Fersion 5elease IB: a$$e$ a co#le of en"ance&ents &ost

notably t"ey increase$ t"e len%t" of a fiel$ na&e to a n#&ber so lar%e not e'en &a%a)ine

a#t"ors t"at $onRt =rite real*=orl$ co$e co#l$ co&lain abo#t it any&ore. T"ey also a$$e$

one or t=o ne= $ata tyes ro#n$in% o#t 59 IF so t"at it s#orts all AS/400 $ata tyes

ecet 'ariable len%t" fiel$s. T"is 'ersion of 59 IF is <no=n as 59 IF 5elease .

T"e follo=in% table i$entifies t"e c#rrent releases of 59 IF. Note t"at 59 IF

releases $o not necessarily coinci$e =it" releases of t"e oeratin% syste&.

59 IF

5elease

OS/400 Fersion/5elease

8IS8 or 5IS8

F 5 8IS8

7 F 5G 5IS8

7 F 57 8IS8

F 5 5IS8

4 F4 57 5IS8

4 F 5 1sec#lation2

See note

8IS8

F4 5 5IS8

F4 54 1,ebr#ary 2 5IS8

G F4 5 1S#&&er 70002 5IS8

a%e 0of

Page 110: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 110/118

AS/400 QUESTION BANK 

NOTE 1H It is sec#late$ t"at IB: &ay s"i a final Zclean #Z release of OS/400 for 8IS8

t"at =o#l$ incl#$e$ a lar%e le'el of co&atibility =it" OS/400 F4 5.

T"e release le'els of 59 IF are only i&ortant if yo# =ant to <ee trac< of t"at

<in$ of t"in%. One $isaointin% iss#e is t"at #nless yo# stay on t"e &ost c#rrent release of 

OS/400 yo# $onRt %et all t"e cool ne= feat#res in 59 IF. E'en if yo# stay c#rrent yo#

canRt tar%et rior releases if yo# #se any of t"e ne= feat#res. In fact e'en if yo# #se a ne=

feat#re t"at $oesnRt $een$ on an oeratin% syste& en"ance&ent it canRt be #se$ for bac< 

releases. T"is is beca#se of t"e =ay t"e T9T5LS 1tar%et release2 feat#re "as been

i&le&ente$. Basically if yo#Rre on F4 57 an$ yo# $o a T9T5LS1F57:02 t"e co&iler 

calls t"e act#al co&iler for F 57. It $oesnRt "a'e a b#ilt*in synta c"ec<er t"at says ZT"is

feat#re reD#ires an OS/400 #%ra$e so $onRt allo= it or t"is one is o<ay so accet it.Z It

iscallin% t"e sa&e ZbinaryZ co&iler co$e t"at is on any ol$ F 57 syste&. ;"ic" &eansfor ea&le t"at if yo# =ant to ta<e a$'anta%e of t"e ne= co&iler $irecti'es b#t yo#

often "a'e to tar%et a rior release yo# canRt #se t"ose $irecti'es. ,or ea&le /I,

CE,INEC $oes not"in% for t"e eec#table co$e t"atRs %enerate$ b#t is not s#orte$ ="en

T9T5LS1F57:02 is secifie$. 1 B#&&er\2

So no= =e <no= abo#t 59 IF release le'els an$ "o= t"e ter& ZILE 59Z %ot

into o#r 'ocab#lary. So letRs clear # anot"er ter& t"e na&e of t"e 59 lan%#a%e. T"e bi%

one is t"e ter& Z59/400Z. T"ere is not ro%ra&&in% lan%#a%e calle$ Z59/400Z. T"e

lan%#a%e &ost often calle$ Z59/400Z is 59III. 3o=e'er bac< in t"e Syste&/ $ays

t"e Syste&/ 59 lan%#a%e =as calle$ 59III. ;"en t"e AS/400 =as anno#nce$

 ro%ra&&ers =ante$ to %i'e t"e&sel'es an a$'anta%e on t"eir r]s#&]. So t"ey be%an

callin% AS/400 59III Z59/400Z. T"en to &a<e &atter =orse ="en 59 IF =as

anno#nce$ ro%ra&&ers t"o#%"t t"at t"e n#&ber ZIFZ in Z59 IFZ =as less t"an t"e

Z400Z in Z59/400Z. So t"ey $eci$e$ to call 59 IF ZILE 59Z. ;ell letRs set t"e recor$

strai%"t. T"e table belo= lists t"e 59 lan%#a%e na&es t"eir incorrect na&e an$ t"e roer na&e.

(!!nly %se

3r!n- Nae

+!ral Nae *r!&er 5#!rre#t6

Nae

a%e 0of

Page 111: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 111/118

AS/400 QUESTION BANK 

59/G Syste&/G*co&atible 59II 59II

59/ Syste&/*co&atible 59III 59III

59/400 59III 59III

ILE 59 59 IF 59 IF

1. ! ! I e#lare an array it' a ynai# n%ber !f eleents?

In 59 IF t"e ne= 1F 52 ALLO8 5EALLO8 an$ CEALLO8 oeration co$es

can be #se$ to allocate &e&ory. T"is &eans t"at at r#n ti&e yo# can %o o#t to t"e syste&

an$ as< it to assi%n stora%e to t"e ro%ra& t"at =as not allocate$ to t"e ro%ra& ="en it

=as e'o<e$.

T"ese oeration co$es can be #se$ to allocate &e&ory # to G:B. T"e allocation can be

assi%ne$ to a ointer 'ariable. In 59 IF ointers "a'e t"e $ata*tye of asteris< 1!2. All

t"at is nee$e$ is to allocate &e&ory to a ointer t"at is #se$ =it" t"e BASEC <ey=or$ of 

t"e $esire$ $yna&ic array. T"e ea&le t"at follo=s ill#strates t"is tec"niD#eH

.....CNa&eEUCS.......Len%t"TCc.,#nctions

  C CynoArr S 0 Ci&100002 base$1 CynoArr2

  C nSi)e S 0i 0

.....8S5n0..............O8o$e1e2Eten$e$*factor7

  8 E'al nsi)e si)e1CinoArr2 ! G4

.....8S5n0,actorO8o$e1e2,actor75es#ltLen

Cc3iLoED

  8 Alloc nSi)e CynoArr 

  !! ;e no= "a'e eno#%" stora%e allocate$ for G4 ele&ents.

  8 E'al nsi)e si)e1CinoArr2 ! 0

  8 5eAlloc nSi)e CynoArr 

  !! ;e "a'e c"an%e$ t"e allocation to eno#%" stora%e for 0 ele&ents

  8! ... co$e to #se t"e array %oes "ere...

  8 Cealloc1N2 CynoArr 

a%e of

Page 112: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 112/118

AS/400 QUESTION BANK 

  !! ;e "a'e j#st ret#rne$ t"e stora%e to t"e syste&. 

To increase or $ecrease t"e n#&ber of ele&ents in t"e $yna&ic array #se t"e

5EALLO8 oeration co$e. Si&ly c"an%e t"e n#&ber of bytes t"at nee$ to be allocate$

an$ call 5EALLO8 =it" t"e ne= si)e in ,actor 7 an$ t"e ori%inal ointer 'ariable in t"e

5es#lt fiel$. 5EALLO8 allocates ne= stora%e of t"e si)e secifie$ an$ coies t"e ori%inal

$ata to t"at ne= location. T"en it frees 1Z$eallocatesZ2 t"e ori%inal stora%e.

I:O5TANTH Al=ays re&e&ber to CEALLO8 anyt"in% yo# ALLO8. T"at is

al=ays free # &e&ory t"at yo# "a'e allocate$ ot"er=ise &e&ory lea<s =ill be create$.

If yo# are not on F 5 yo# can still #se $yna&ic &e&ory by callin% one of t"e

syste& AIs or lin<in% into t"e Q87LE bin$in% $irectory an$ callin% t"e 8 r#nti&e

:ALLO8 an$ CEALLO8 f#nctions.

1$. )* I @ B%ilt@in +%n#ti!ns

T"e ori%inal release of 59 IF incl#$e$ a set of b#ilt*in f#nctions. T"ese b#ilt*in f#nctions

=ereH

ACC5 ACC5 SIJE ELE: SUBST T5I: T5I:L T5I:5 

In a$$ition #n$er OS/400 F57 an$ F5 t"e A5:S b#ilt*in f#nction =as intro$#ce$.

Since t"en se'eral b#ilt*in f#nctions "a'e been a$$e$ to 59 IF. T"e follo=in% table

 ro'i$es t"e OS/400 Fersion an$ 5elease t"at t"e secific b#ilt*in f#nctions =ere

intro$#ce$ an$/or en"ance$.

 NOTEH IB: See&s to s<i*s"i t"e 59 IF co&iler. So 59 IF in F45 F45 an$

F45 "a'e no ne= f#nctionality. T"e net sc"e$#le$ #%ra$e is OS/400 F5 in Srin%

700.

Fersion

5elease

B#ilt*in ,#nction ara&eters 5et#rn Fal#e Cescrition

F5 ABS n#&eric eression Absol#te 'al#e of eression

a%e 7of

Page 113: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 113/118

AS/400 QUESTION BANK 

  ACC5 'ariable na&e A$$ress of 'ariable

F5 ALLO8 &e&ory si)e ointer to t"e allocate$ stora%e.

F457

F454

83A5 %ra"ic $ate ti&e

ti&esta& or  

n#&eric eression

Fal#e in c"aracter $ata tye

F5 83E8K co&are*'al#e H$ata*to*searc" ^ H

start*osition _

,irst osition in t"e searc"e$*$atat"at contains a c"aracter not in

t"e list of t"e c"aracters in t"e

co&are 'al#e.

F5 83E8K5 co&are*'al#e H

$ata*to*searc" ^ Hstart*osition _

Last osition in t"e searc"e$*$ata

t"at contains a c"aracter not int"e list of t"e c"aracters in t"e

co&are 'al#e. 1Searc" be%ins

=it" t"e ri%"t*&ost c"aracter an$ rocee$s to t"e left.

F5 CATE ^ 'al#e ^ H $ate*for&at*co$e _

A $ate $ata*tye 'al#e after con'ertin% t"e Z'al#eZ to t"e

secifie$ $ate for&at. If no 'al#e

is secifie$ t"e c#rrent syste&$ate is ret#rne$.

F5 CA(S $ays A $#ration 'al#e t"at can be #se$

in an eression to a$$ a n#&ber 

of $ays to a $ate 'al#e.

F5 CE8 n#&eric eression

^H$i%its H $ecos_

Fal#e in ac<e$ n#&eric for&at.

If $i%its an$ $ecos are secifie$t"e res#lt 'al#e is for&atte$ to fit

in a 'ariable of t"e n#&ber of 

$i%its secifie$.

F5 CE83 n#&eric eression H

$i%its H $ecos

3alf*a$j#ste$ 'al#e in ac<e$

n#&eric for&at. T"e len%t" an$$eci&al ositions

F5 CE8OS n#&eric eression N#&ber of $eci&al $i%its.

F5 CI,, start*$ate H en$*$ate H $#ration*co$e

8alc#lates t"e $ifference bet=eent=o $ate fiel$s. T"e tye of 

$ifference ret#rne$ is secifie$ by

t"e $#ration*co$e.

F454 CIF N#&erator H erfor&s inte%er $i'ision an$

a%e of

Page 114: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 114/118

AS/400 QUESTION BANK 

Ceno&inator ret#rns t"e D#otient 1res#lt2 of  t"at $i'ision oeration.

F5 ECIT8 non*float n#&ericeression H e$it

co$e ^H!8U5S(: [

!AST,ILL [c#rrency sy&bol_

Strin% reresentin% e$ite$ 'al#e.

F5 ECIT,LT n#&eric eression 8"aracter eternal $islay

reresentation of float.

F5 ECIT; non*float n#&eric

eression H e$it

=or$

Strin% reresentin% e$ite$ 'al#e

  ELE: array table or  

&#ltile occ#rrence$ata str#ct#re na&e

 N#&ber of ele&ents or 

occ#rrences

F457 EO, ^file na&e_ RR if t"e &ost recent file in#toeration or =rite to a s#bfile 1for 

a artic#lar file if secifie$2 [

en$e$ in an en$*of*file or [ be%innin%*of*file con$ition R0R

ot"er=ise.

F457 EQUAL ^file na&e_ RR if t"e &ost recent SETLL 1for  

a artic#lar file if secifie$2 or LOOKU oeration fo#n$ aneact &atc" R0R ot"er=ise.

F457 E55O5 RR if t"e &ost recent oeration

co$e =it" eten$er RER secifie$

res#lte$ in an error R0R ot"er=ise.

F5 ,LOAT n#&eric eression Fal#e in float for&at.

F457 ,OUNC ^file na&e_ RR if t"e &ost recent rele'ant

oeration 1for a artic#lar file if 

secifie$2 fo#n$ a recor$183AIN CELETE SET9T

SETLL2 an ele&ent 1LOOKU2

or a &atc" 183E8K 83E8K5S8AN2 R0R ot"er=ise.

F454 95A3I8 Any c"aracter 'al#e 8on'erts c"aracter $ata to$o#ble*byte c"aracter set 'al#e.

a%e 4of

Page 115: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 115/118

AS/400 QUESTION BANK 

F5 3OU5S "o#rs A $#ration 'al#e t"at can be #se$in an eression to a$$ a n#&ber 

of "o#rs to a ti&e 'al#e.

F5 INT n#&eric eression Fal#e in inte%er for&at

F5 INT3 n#&eric eression 3alf*a$j#ste$ 'al#e in inte%er  for&at

F5 LEN any eression . 5et#rns t"e len%t" of a

'ariable or literal 'al#e or 

t"e c#rrent len%t" of a'aryin% len%t" fiel$.

7. ;"en #se$ on t"e left si$e

of t"e eD#al si%n sets t"e

len%t" of a 'aryin% len%t"

fiel$.

F5 LOOKU searc"*$ata H array^ H start*in$e ^ H

ele&ents to

searc" __

An array in$e of t"e ele&ent int"e array ="ere t"e searc"*$ata is

locate$.

F5 TLOOKU searc"*$ata Hsearc"e$*table ^ H

alternate*table _

!ON if t"e searc" is s#ccessf#lot"er=ise !O,,. 1NOTEH T"e

in$ees of t"e searc"e$*table an$

alternate*table are set to t"e in$e

of t"e searc"*$ata if !ON isret#rne$.2

F5 :INUTES &in#tes A $#ration 'al#e t"at can be #se$

in an eression to a$$ a n#&ber 

of &in#tes to a ti&e 'al#e.

F5 :ONT3S &ont"s A $#ration 'al#e t"at can be #se$

in an eression to a$$ a n#&ber of &ont"s to a $ate 'al#e.

F5 :SE8ONCS &illisecon$s A $#ration 'al#e t"at can be #se$in an eression to a$$ a n#&ber 

of &illisecon$s to a ti&e 'al#e.

F5 NULLINC n#ll*caable fiel$

na&e

Fal#e in in$icator for&at

reresentin% t"e n#ll in$icator 

settin% for t"e n#ll*caable fiel$.

F5 O88U5 $ata*str#ct#re T"e c#rrent occ#rrence of t"e

a%e of

Page 116: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 116/118

AS/400 QUESTION BANK 

$ata str#ct#re or sets t"e c#rrentocc#rrence of t"e $ata str#ct#re

F457 OEN file na&e RR if t"e secifie$ file is oen R0Rif t"e secifie$ file is close$.

8onsi$er t"is b#ilt*in to be an RIs

t"is file oenWZ oeration.

  ACC5 roce$#re na&e A$$ress of roce$#re

F57

F5G

A5:S N#&ber of ara&eters asse$ to

 roce$#re

F5 5EALLO8 ointer H ne=*si)e ointer to t"e allocate$ stora%e.

F454 5E: N#&erator H

Ceno&inator 

erfor&s inte%er $i'ision an$

ret#rns t"e re&ain$er fro& t"e

$i'ision oeration.

F457 5ELA8E relace&ent strin%Hso#rce strin% ^Hstart

 osition ^Hso#rce

len%t" to relace__

Strin% ro$#ce$ by insertin%relace&ent strin% into so#rce

strin% startin% at start osition

an$ relacin% t"e secifie$n#&ber of c"aracters.

F5 S8AN searc" ar%#&ent Hstrin% to be searc"e$

^Hstart osition_

,irst osition of searc" ar%#&entin strin% or )ero if not fo#n$.

F5 SE8ONCS secon$s A $#ration 'al#e t"at can be #se$

in an eression to a$$ a n#&ber 

of secon$s to a ti&e 'al#e.

F5 S3TCN !ON if t"e job is bein% s"#t $o=n1e.%. ="en t"e ;5C;NS(S

co&&an$ is iss#e$2 ot"er=ise

!O,, is ret#rne$.

  SIJE 'ariable $ata

str#ct#re array or literal ^H !ALL_

 N#&ber of bytes #se$ by 'ariable

or literal. !ALL ret#rns t"en#&ber of bytes #se$ by all t"e

ele&ents of t"e array or all t"e

occ#rrences of t"e $ata str#ct#re.

F5 SQ5T eression or 'al#e T"e sD#are root of t"e eression

or 'al#e.

F457 STATUS ^file na&e_ 0 if no ro%ra& or file error  

a%e Gof

Page 117: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 117/118

AS/400 QUESTION BANK 

occ#rre$ since t"e &ost recentoeration co$e =it" eten$er RER

secifie$ &ost recent 'al#e set

for any ro%ra& or file stat#s if an error occ#rre$ if a file is

secifie$ t"e 'al#e ret#rne$ is

t"e &ost recent stat#s for t"at file.

F5 ST5 ointer^H&ai&#&

len%t"_

8"aracters a$$resse$ by ointer 

ar%#&ent # to b#t not incl#$in%t"e first R00R.

F5 SUBCT $ate H $#ration*co$e T"e etracte$ co&onent of t"e$ate 'al#e. 1T"e f#nctional

eD#i'alent of t"e ET58T

oeration co$e.2

  SUBST strin%Hstart^Hlen%t"_ S#bstrin% 'al#e. If len%t" is notsecifie$ t"e s#bstrin% be%ins=it" start an$ contin#es t"ro#%"

t"e en$ of t"e strin%.

F5 T3IS Use$ for ?a'a inte%ration.

5et#rns an Object reference.

F5 TI:E ^ 'al#e ^ H ti&e*

for&at*co$e _

A ti&e $ata*tye 'al#e after 

con'ertin% t"e Z'al#eZ to t"esecifie$ ti&e for&at. If no 'al#e

is secifie$ t"e c#rrent syste&ti&e is ret#rne$.

F5 TI:ESTA: ^'al#e ^ H !ISO [

!ISO0 _

A ti&esta& $ata*tye 'al#e =it"

or =it"o#t searators.

  T5I: strin% Strin% =it" left an$ ri%"t blan<s

tri&&e$ 1re&o'e$2

  T5I:L strin% Strin% =it" left blan<s tri&&e$

  T5I:5 strin% Strin% =it" ri%"t blan<s tri&&e$

F454 U8S7 Any c"aracter 'al#e 5et#rns a 'aryin% len%t" 'al#e.

F457 UNS n#&eric eression Fal#e in #nsi%ne$ for&at

F457 UNS3 n#&eric eression 3alf*a$j#ste$ 'al#e in #nsi%ne$

for&at

a%e of

Page 118: as-400 bank

7/26/2019 as-400 bank

http://slidepdf.com/reader/full/as-400-bank 118/118

AS/400 QUESTION BANK 

F5 LATE fro&*table H to*table H strin%*to*

con'ert ^ H startin%*

 osition _

T"e con'erte$ strin% is ret#rne$.

F454 ,OOT Array na&e 8ross foots 1totals2 all t"e

ele&ents in an array.