Você está na página 1de 17

AS/400 Exercises

AS/400
EXERCISES
Exercise 1
Objective : To familiarize the menu options and keyboard functions in AS/400 and
to run throu!h the basic commands of OS/400"
#asic $ommands :
%nter the USER-ID and PASSWORD and &ress ENTER key on the Si!n On
screen" The AS/400 MAIN MENU SCREEN appears if above details are
valid and correct"
On the MAIN MENU SCREEN you can type any command on the command
line or choose any option from the menu"
$hoose option 5 (Programming) and then option 2(PDM) from the ne't
screen or type WRKMBRPDM to (ork (ith members for a source &hysical file
and )ibrary"
On MAIN MENU SCREEN $hoose option ! (IN"ORMATION
ASSISTAN#E OPTION) and then option 2 $or ON-%INE EDU#ATION or
option 22 $or &UESTION AND ANSWER SESSION from the ne't screen'
&ress " or ()*p +), at any point to !et on*line help"
At the end of this session you (ill be able to SI-N-ON and look throu!h the various basic
options of the system and perform basic editin! usin! SOUR#E ENTR. UTI%IT. (SEU)
Exercise 2
Objective : To familiarize usa!e of SEU by creatin! physical files and DFU by
enterin! data"
$reate D)partm)nt and Emp*o,)) P/,0i1a* $i*)0 (ith the follo(in! formats"
a+ Department File
,ecord -ame : DEPREC
.ields:
DEPID (D)partm)nt ID) #(AR(2) - K),
DEPNM (Nam)) #(AR(2!)
DNEMP (No' o$ )mp*o,))0) NUM(2)
b+ Employee File
,ecord -ame : EMPREC
.ields:
EMPID (Emp*o,)) ID)#(AR(5) - K),
EMPNM (Nam)) #(AR(2!)
EMPDP (D)partm)nt) #(AR(2)
EMPDS (D)0ignation) #(AR(3)
EMPBA (Ba0i1) NUM(452)
EMPDA (DA) NUM(452)
EMPVA (6A) NUM(452)
EMPHR ((RA) NUM(452)
/" %nter data for the files usin! DFU
At the end of this session you (ill be able to create P/,0i1a* $i*)0 and use D"U
Exercise 3
Objective : To familiarize (ith %ogi1a*5 7oin *ogi1a* $i*)0 and &8)r,93!!
0" $reate a lo!ical file on %mployee usin! 1epartment as key"
/" $reate a 2oin )o!ical file usin! %mployee and 1epartment files (ith department code
as the join factor"
3" 4se 5uery/400 to obtain the follo(in!:
1epartment(ise list of employees (ith total no of employees and total no" of
departments"
All employees (hose names be!in (ith 6S6"
All employees (ith a !iven desi!nation and total no" of such employees"
All employees (hose #asic Salary lies (ithin the !iven ran!e
At the end of this session you (ill be able to create %ogi1a* $i*)05 7oin %ogi1a* $i*)0 and
80) &8)r,93!!'
Exercise 4
Objective : To familiarize (ith S!reen De"i#n Ai$"
1esi!n Screens usin! SDA for editin! D)partm)nt and Emp*o,)) files" The Screens
should have the follo(in! format"
Employee %ey S!reen
$o!nizant Application -ame dd/mm/yy
Screen Title 4S%,71
%mployee 7d 88888888
F&'E(it F)'Delete
Employee Detail" S!reen
$TS Application -ame dd/mm/yy
Screen Title 4S%,71
%mployee 7d OOOOOOO
%mployee -ame 888888888888888888
1epartment 88888888 1es! 888888
#asic 88888888 1A 888888 9,A 888888
:ehicle Allo(ance 8888888888 -et &ay 888888
F&'E(it F)'Delete
Department *ey S!reen
Page: 1
Exercise 4
$o!nizant Application -ame dd/mm/yy
Screen Title 4S%,71
1epartment 7d 88888888
F&'E(it F)'Delete
Department Detail" S!reen
$o!nizant Application -ame dd/mm/yy
Screen Title 4S%,71
1epartment 7d OOOOOOO
1epartment -ame 888888888888888888
-o" of employees 88888888
F&'E(it F)'Delete
At the end of this session you (ill be able to desi!n screens usin! SDA
Page: 2
Exercise 5
Objective : To familiarize (ith RP+"
4sin! the screens created in the previous e'ercise Add ;odify and 1elete %mployee
records"
Add:
:erify that the employee code does not e'ist in the file
The department entered should e'ist in the department file
Modi$,:
The employee code should e'ist in the file
Allo( chan!es in non*key fields only
:alidate 1epartment code"
D)*)t):
The employee code should e'ist in the file
After enterin! the employee code if .< is pressed display the record in output
mode=&rotected mode+" 7f the user no( presses %nter key delete the record"
Note
0" 7n case of any error the correspondin! field should be sho(n in ,everse 7ma!e
/" $4A =7#; SAA+ Standards for .unctions >eys"
F,n!tion %ey" -peration
.0 ()*p
./ N);t S1r))n
.3 E;it
.4 Prompt
.? R)$r)0/
.@ #r)at)
.< D)*)t)
.0/ #an1)*
At the end of this session you (ill be able to (rite pro!rams in RP-
Exercise 7
Objective : To familiarize (ith S,./ile pro!rammin!
#r)at) a 08<$i*) maint)nan1) program $or t/) Emp*o,)) $i*)'
T/) 01r))n *a,o8t 0/o8*d <) a0 $o**o=0
$o!nizant Application -ame dd/mm/yy
Screen Title 4S%,71
0ype -ption"1 Pre"" Enter
2'C3an#e 4'Delete 4'Di"play
-pt Emp I$ Name Department Ba"i! De"i#nation
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
88 888888 88888888888 88888888 8888 888888888
F&'E(it F5'Create
7n the above screen the fields %mp7d -ame 1epartment #asic A 1esi!nation (ill be
Output only" Only the option field (ill be 7nput capable
Page: 1
Exercise 7
7n case of option /4 or ? a (indo( record should be displayed (ith the follo(in! layout"
Mo$e 66666666
Emp I$ Name Dept De"i#nation Ba"i! DA HRA VA
6666666 666666666666 6666 6666666666 66666 6666 66666 666
F72'Can!el
7f option is / allo( chan!e in the correspondin! %mployee record =all fields e'cept
%mployee 7d+
7f option is 4 display the correspondin! %mployee record in protected mode and (hen
Ent)r key is pressed delete the record"
7f option is ? display the correspondin! %mployee record in protect mode"
The function keys should (ork as follo(s:
.3 B %'it from pro!ram
.@ B ;odify and use the employee pro!ram done in e'ercise ? to add records
At the end of this session you (ill be able to (rite pro!rams usin! S8<$i*)0
Page: 2
Exercise 6
Objective : To familiarize (ith ARRA8 handlin! in RP+
Crite a pro!ram to display the calendar for a !iven month" The month is entered as input"
Calen$ar Initial "!reen
$o!nizant Application -ame dd/mm/yy
Screen Title 4S%,71
Enter t3e mont3 66666666

F&'E(it
Calen$ar Detail S!reen
$o!nizant Application -ame dd/mm/yy
Screen Title 4S%,71
SUN M-N 0UE 9ED 0HU FRI SA0
6666 66666 6666 66666 6666 6666 6666
6666 66666 6666 66666 6666 6666 6666
6666 66666 6666 66666 6666 6666 6666
6666 66666 6666 66666 6666 6666 6666
6666 66666 6666 66666 6666 6666 6666
6666 66666 6666 66666 6666 6666 6666
F&'E(it
At the end of this session you (ill be able to (rite pro!rams in RP+ usin! arrays"
Exercise 8
Objective : To familiarize R:U
Crite a pro!ram to print a department*(ise list of employees (ith total no" of employees
per department
The report should have the follo(in! layout
$o!nizant Application -ame dd/mm/yy
,eport Title 4S%,71
Department 6666666666 Name 66666666666666666666
Emp I$ Name Ba"i! De"i#nation
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
888888 88888888888 88888888 888888888
0otal no o/ Employee" 66666666666
At the end of the session you (ill be able to (rite pro!rams usin! R:U
Exercise 9
Objective : To familiarize (ith Men,;" < C: pro#rammin#
a) $reate a menu throu!h S1A (ith the follo(in! options"
' Ma0t)r Maint)nan1)
2' S8<$i*) Maint)nan1)
2' #a*)ndar
3' R)port
The master maintenance should in turn include:
a' D)partm)nt ma0t)r
<' Emp*o,)) ma0t)r
<) Crite a $) pro!ram for e'ecutin! this menu"
$o!nizant Application -ame dd/mm/yy
;enu Title 4S%,71
7 Ma"ter Maintenan!e
2 S,./ile Maintenan!e
& Calen$ar
4 Report
F&'E(it
$o!nizant Application -ame dd/mm/yy
Page: 1
Exercise 9
;enu Title 4S%,71
7 Department Ma"ter
2 Employee Ma"ter
-ption 66666
F&'E(it
1) Crite a $) pro!ram (hich takes care of follo(in!"
i" A11)pt a D)partm)nt 1od) $rom t/) 01r))n
ii' "i*t)r0 t/o0) r)1ord0 $rom Emp*o,)) Ma0t)r =it/ t/) parti18*ar d)partm)nt
iii' Di0p*a, t/)0) r)1ord0 80ing 08<$i*)'
d) $opy t(o database files usin! OS/400 $ommand CPYF
At the end of the session you (ill be able to desi!n menu6s and (rite $) pro!rams"
Page: 2
Exercise 10
Objective : To put additional effort on difficult e'ercises"
= As su!!ested in the class room session+
Exercise 11
Objective : To familiarize (ith S=:/400
a+ Crite an ,&D pro!ram (ith embedded S5) to select all %mployees from a !iven
department"
Employee In>,iry Initial S!reen
SEuare 1 Soft(are )td Application -ame dd/mm/yy
;enu Title 4S%,71
Enter Department 6666666666

F&'E(it
Employee In>,iry Detail S!reen
$o!nizant Application -ame dd/mm/yy
,eport Title 4S%,71
Department 6666666666 Name 666666666666666666666
-pt Emp I$ Name Ba"i! De"i#nation
666 666666 6666666666666 88888888 6666666
666 666666 6666666666666 88888888 6666666
666 666666 6666666666666 88888888 6666666
666 666666 6666666666666 88888888 6666666
666 666666 6666666666666 88888888 6666666
666 666666 6666666666666 88888888 6666666
666 666666 6666666666666 88888888 6666666
F&'E(it
,etrieve the company name A 4ser 7d from )1A for this screen and report pro!rams"
b+ $reate a 1ata 5ueue and send and receive data from the 1ata 5ueue you created"
At the end of this session you (ill be able to (rite pro!rams in RP- usin! )m<)dd)d S&%
and also use 1ata areas A 1ata 5ueues"
Page: 1
Exercise 12
Objective : To familiarize usa!e of 1ata Structures
0" $han!e the pro!ram (ritten in e'ercise F so that you check for the end of the pa!e
condition based on current line number usin! the &ro!ram 7nformation 1ata Structure
=7-.1S+"
/" Crite a pro!ram so that it accepts the date in one format and converts it into another
format usin! data structures"
3" Crite a pro!ram (hich takes care of record lockin! conditions and run the same
pro!ram in both sessions"
At the end of this session you (ill be able to (rite pro!rams in RP- usin! 1ata Structures
and also take care of record lockin! conditions"
Exercise 13
Objective : To familiarize pa!e by pa!e buildin! of subfiles
Crite a pro!ram in ,&D to repeat the functions performed in e'ercise < but build the
Subfile pa!e by pa!e"
At the end of this session you (ill be able to (rite pro!rams in RP- (hich handles pa!e
by pa!e buildin! of Subfiles"

Você também pode gostar