Professional Documents
Culture Documents
cover
iSeries System
Administration and Control
Student Exercises
ERC 7.0
Trademarks
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AS/400® C/400® DB2®
DB2 Universal Database™ Domino™ DRDA®
iSeries™ Lotus® Netfinity®
OfficeVision® OfficeVision/400™ Operating System/400®
OS/400® PowerPC® Redbooks™
ServerProven® Service Director™ System/36™
WebSphere® xSeries® 400®
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Microsoft, Windows and Windows NT are trademarks of Microsoft Corporation in the
United States, other countries, or both.
Intel and Pentium are trademarks of Intel Corporation in the United States, other countries,
or both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Linux is a registered trademark of Linus Torvalds in the United States and other countries.
Other company, product and service names may be trademarks or service marks of others.
The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.
© Copyright International Business Machines Corporation 1995, 2003. All rights reserved.
This document may not be reproduced in whole or in part without the prior written permission of IBM.
Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions
set forth in GSA ADP Schedule Contract with IBM Corp.
V2.0.0.3
Student Exercises
TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
iv iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
TMK Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AS/400® C/400® DB2®
DB2 Universal Database™ Domino™ DRDA®
iSeries™ Lotus® Netfinity®
OfficeVision® OfficeVision/400™ Operating System/400®
OS/400® PowerPC® Redbooks™
ServerProven® Service Director™ System/36™
WebSphere® xSeries® 400®
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Microsoft, Windows and Windows NT are trademarks of Microsoft Corporation in the
United States, other countries, or both.
Intel and Pentium are trademarks of Intel Corporation in the United States, other countries,
or both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Linux is a registered trademark of Linus Torvalds in the United States and other countries.
Other company, product and service names may be trademarks or service marks of others.
vi iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
viii iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
© Copyright IBM Corp. 1995, 2003 Exercise 1. Establishing a User Environment 1-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-2 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
© Copyright IBM Corp. 1995, 2003 Exercise 1. Establishing a User Environment 1-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
What output queue does the job description use? (Or where does the system look
for the name of the output queue?) ______________________________________
What libraries are in the initial library list? _________________________________
__ 11. From the iSeries Navigator panel create a user profile named PROGxx, where xx is
your team id. Specify the following:
- User class: specify a value appropriate for a programmer.
- Current library: LIBxx
- Initial menu: PROGRAM
- Job description: JOBDxx in LIBxx
- Accounting code: PROGRAMMER
- Output queue: OUTQxx in LIBxx
__ 12. After creating the user profile PROGxx, check that all the parameters have the
correct values. If you made a mistake, correct them.
__ 13. Next you are going to give permission to PROGxx to use certain objects. Four
different techniques are available:
- Group profile
- Authorization list
- Individual permission (one per object or group of objects)
- Grant using a referenced user
You already have some experience with group profile, authorization list, and
individual permission from the security lab. Group profile and authorization list are
usually preferable to the grant using referenced user technique. The first two
techniques continue to update the authority of the users as the group profile is
changed, or the authorization list is changed. The grant using referenced user
technique only grants authority one time. The grant, in essence, copies the
authorizations from one user to another. Any changes made to a particular user in
the future will not affect other users.
In this section, you will use the grant using a referenced user technique. Execute
the command DSPUSRPRF USRPRF(PROGxx) TYPE(*ALL). You will see several
screens of information displayed one at a time.
Press Enter until you see the Display Authorized Objects screen. How many objects
is PROGxx specifically authorized to use? _______
Press Enter until you see the Display Owned Objects screen. How many objects
does PROGxx own? __________
What is the total number of objects that PROGxx either owns or is specifically
authorized to use? __________
1-4 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
© Copyright IBM Corp. 1995, 2003 Exercise 1. Establishing a User Environment 1-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
END OF LAB
1-6 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
© Copyright IBM Corp. 1995, 2003 Exercise 1. Establishing a User Environment 1-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-8 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty __ 4. F3 from the DSPLIBL display should return you to the Programming menu. If not,
key GO PROGRAM.
__ 5. Self-explanatory.
__ 6. Self-explanatory.
__ 7. Self-explanatory.
__ 8. The compile of member TEST was submitted to batch.
__ 9. Job xxxxxx/PROGxx/TEST completed normally on (date) at (time). Use DSPMSG.
__ 10. Self-explanatory
__ 11. Device or Queue: OUTQxx
__ 12. GO PROGRAM
DSPLIB LIBxx
__ 13. CALL TEST
__ 14. SIGNOFF: SIGNOFF
END OF LAB
© Copyright IBM Corp. 1995, 2003 Exercise 1. Establishing a User Environment 1-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-10 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
Exercise Instructions
2-2 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty
COMMAND EXECUTABLE?
Actual Result Expected Result
CHGPWD(menu #8) Yes
CHGPWD (keyed) No
DSPJOB Yes
CRTUSRPRF No
CRTJRNRCV No
WRKOUTQ No
Note: Because this user has limited capability, only a few commands can be
executed. Any menu options can be taken.
__ 9. Sign off and you will be returned to Sign-on menu.
Step 2: Change a user profile
__ 1. Now you are going to change the user profile that you created earlier. Go to the your
iSeries Navigator window.
Open Users an Groups, double-click All Users and double-click (or select
Properties) USRxx on right pane.
- Change the initial program parameter to QCMD
- Change the limited capability value to Do not limit
__ 2. After the user profile has been changed, go to the 5250 session and sign on as
USRxx. Do not specify a menu or program at sign on.
You should now see the Command Entry display. (Any initial program specified in
the user profile will be executed before the initial menu is displayed.)
2-4 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty __ 4. Secure the file CUSMSI with your authorization list, and give the (Public) Exclude
permission.
__ 5. Open Security, Authorization List and AUTLxx (on right pane). Write the names of
the users, and their permissions, here:
_________________________________________________________________
_________________________________________________________________
__ 6. Press Secured Objects.
You should see that BUILD and CUSMSI are secured by your authorization list.
__ 7. Close the two panels.
How many authorization lists are listed on right pane? _________
Which Permissions do the authorization lists that you see, besides your own, have?
(How is it you can display them?)
____________________________________________________________
__ 8. Open a second 5250 session and sign on to the system, using the OL50xx profile.
__ 9. Key the command CRTCLPGM PGM(TIME) AUT(AUTLxx), where xx is your team
number. You are creating a control language program, owned by you, and secured
by your authorization list.
__ 10. Go to the your iSeries Navigator window and find the objects secured by your
authorization list. TIME should be on the list.
__ 11. Use the appropriate selection to display the list. Which users are on the list and what
authority do they have?
____________________________________________________________
__ 12. Go to the first 5250 session (USRxx should be already signed-on) and CALL TIME.
You should not be authorized.
__ 13. Go to the your iSeries Navigator window and add USRxx to your Authorization list
(AUTLxx) with the Use permission.
__ 14. Go to the first 5250 session (signed on as USRxx), and CALL TIME. You should be
authorized.
2-6 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty __ 10. Return to your iSeries Navigator window and, assign Change Permission for USRxx
to MSGQxx to allow USRxx to delete messages from the queue, send messages to
it, but NOT DELETE the message queue.
__ 11. Go to the first 5250 session (signed on as USRxx), and attempt to delete the
message queue.
Are you allowed to delete the message queue? The command is DLTMSGQ.
Are you allowed to display the messages in the queue? The command is DSPMSG
____
Are you allowed to delete the messages in the queue? The command is CLRMSGQ
____
Are you allowed to send a message to the queue? The command is SNDMSG ____
Note: If you have established security properly, the answer to the first question is
NO and the next three answers are YES.
__ 12. Return to your iSeries Navigator window and assign USRxx permission All to
MSGQxx, to allow USRxx to delete the message queue.
__ 13. Go to the first 5250 session (signed on as USRxx), and attempt to delete the
message queue.
Are you allowed to delete the message queue? ____ The command is DLTMSGQ.
Step 2: Work with adopting a user profile
By adopting a user profile, a user can temporarily gain authority to objects that usually are
not available to him or her. In this section, you will first determine that USRxx is unable to
access certain of your objects. You will then have USRxx adopt your profile, and thereby
gain authority to your objects.
__ 1. Go to your iSeries Navigator window, and remove the CUSMSI file from the control
of the authorization list. To do so select CUSMSI.FILE and Permissions on right
pane, press Authorization List, select (none) from pop-up menu and confirm.
__ 2. Go to the first 5250 session (signed on as USRxx), and CALL BUILD and enter N
and N when prompted.
Are you allowed to run the program? __________
Note: The message about file open errors. ____________
You are authorized to the program but not the files used by the Program.
__ 3. Go to your iSeries Navigator window, and remove the BUILD program from the
control of the authorization list.
__ 4. Scan thoroughly the authorization list objects (Security > Authorization List).
To verify you have removed BUILD and CUSMSI from the authorization list's control.
This has been done to prevent the adopted authority activity you are about to
commence from appearing to you to require the use of an authorization list.
2-8 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty __ 15. Use the appropriate function key to end the BUILD program.
__ 16. Key the command SIGNOFF to end this job.
Step 3: Deleting a user profile
Now you are going to delete the user profile that you created earlier, USRxx.
__ 1. Go to the your iSeries Navigator window and verify that the profile does not own any
objects.
Open Users and Groups, double-click All Users, right-click USRxx on right pane,
select User Objects and Scan for Owned Objects.......and confirm.
Does the USRxx profile own objects?
The USRxx message queue will be deleted automatically when you delete the
profile.
__ 2. Delete the USRxx user profile. Right-click USRxx, select Delete......; if the profile
owns any other objects, delete them.
__ 3. Close all the three windows. This concludes the security lab.
END OF LAB
Exercise Solutions
The commands in this exercise may be executed in the following ways:
• By keying the appropriate command directly
• By using the SECURITY menu (GO SECURITY)
PART A
Step 1: Create a user profile
__ 1. Access the system
Open the your iSeries Navigator window and double-click on system_name under
My Connections
User ID: OL50xx
Password: OL50xx
__ 2. Create a user profile:
- Right-click Users and Groups
- Select New User....
- USRxx
- Press Capabilities
- On Privileges panel select Privilege Class PROGRAMMER from pop-up
menu and confirm (OK)
- Press Jobs
- On the available panels type other required inputs and confirm
- Press ADD button
__ 3. Observe Permission for the user profile:
- Open File System
- Open Integrated File System
- Double-click (Explore) QSYS.LIB
- Find (you can use Edit... Find...) USRxx.USRPRF on right pane
- Right-click USRxx and select Permissions
- Observe Basic and Details
- OL50xx has permission All
- USRxx has Custom permissions: Operational, Management, Read, Add,
Update, Delete, Execute
- USRxx CAN change his profile.
- (Public) has Use permission.
__ 4. Change (Public) Permission
Press Basic and check first row, first column (Public) - Use) radio button
__ 5. 20 bullets
2-10 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
PART B
Step 1: Group profile
__ 1. Error message: Not authorized to program LAB1 in library OL50LIB.
__ 2. Sign off.
__ 3. See below:
- Open Users and Groups
- Open Groups
- Right-click OL50GROUP and select Properties
- Add USRxx and confirm (OK)
__ 4. User....USRxx; Password....yyyyy
Access to LAB1 by USRxx is granted.
__ 5.
- Find LAB1 program (self explanatory - same as previous)
- Right-click LAB1 and select Permissions
- Press ADD and open All Users
2-12 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
PART C
Step 1: Grant object authority
__ 1. CRTMSGQ OL50xx/MSGQxx
__ 2. Observe Permission for the message queue
- Open File System
- Open Integrated File System
- Open QSYS.LIB
- Double-click (Explore) OL50xx.LIB
- Find (you can use Edit... Find...) MSGQxx.MSGQ on right pane
- Right-click MASGQxx and select Permissions
(Public) has Change permission.
__ 3. Display the message queue
DSPMSG MSGQ(MSGQxx)
USRxx gets the authority because (Public) has Change permission.
__ 4. GO USER
__ 5. Send a message
SNDMSG MSG(text) TOMSGQ(MSGQxx)
__ 6. Change Permissions
- Press ADD
- Open All Users
- Select USRxx and confirm (OK)
- Check radio button ON for USRxx - Exclude and confirm (OK)
__ 7. Display the message queue: DSPMSG MSGQ(MSGQxx)
Not allowed to do so.
Error message - Not authorized to message queue MSGQxx.
Not allowed to do so.
__ 8. Change permissions
- Right-click MSGQxx and select Permissions
- Check radio button ON for USRxx - Use and confirm (OK)
USRxx now has Use permission to the message queue.
__ 9. Using the message queue
USRxx MAY DISPLAY messages in the queue.
USRxx MAY NOT DELETE messages in the queue.
USRxx MAY NOT SEND messages to the queue.
USRxx MAY NOT DELETE the message queue.
__ 10. Change permissions
- Right-click MSGQxx and select Permissions
- Check radio button ON for USRxx - Change and confirm (OK)
USRxx now has Change permission to the message queue.
__ 11. Using the message queue
USRxx MAY NOT DELETE the message queue.
USRxx MAY DISPLAY messages in the queue.
USRxx MAY DELETE messages in the queue.
USRxx MAY SEND messages to the queue.
__ 12. Change permissions
- Right-click MSGQxx an select Permissions
- Check radio button ON for USRxx - All and confirm (OK)
USRxx now has All permission to the message queue.
__ 13. Using the message queue
USRxx MAY DELETE the message queue.
2-14 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
2-16 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
Exercise Instructions
Part 1: Using The PRECHK Keyword
This portion of the lab simulates a user staying late to finish some work while the operator
is saving the library:
• Does your Availability Plan provide for this situation?
• Does it collect documentation so that you can look it the following day to see if there
was an error?
__ 1. Sign on to the system, using their user ID and password (OL51xx) where xx is your
user ID.
Important
For the remainder of the labs your User ID and password are
OL51xx and the class library is OL51LIB.
__ 2. Create a save file in your library OL51xx. Name the save file OL51xxSAV1, where
xx is your user ID.
__ 3. Save the library named OL51LIBSAV to your newly created save file. Use
F10=Additional parameters and specify OUTPUT(*PRINT) to get a report of the
save operation.
__ 4. You should receive a message that seven objects were saved and one object was
not saved.
__ 5. Use the WRKSPLF command to find the report (QPSAVOBJ) of the save operation.
Use option 5=Display to view the report. Find the object that was not saved. It
should be file DATAFILE.
If you can not find the report(QPSAVOBJ) use the DSPJOBLOG command, F10
Display detailed information. The joblog also contains information about the used
save operation.
__ 6. Clear the save file OL51xxSAV1, where xx is your user ID, using command
CLRSAVF.
__ 7. Save the library named OL51LIBSAV just as you did before only say *YES for the
PRECHK keyword. You should get another message.
Answer the following questions:
• How many objects were saved? _____________________________________
• Is this better than the save you did in step 5? ____________________________
3-2 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
END OF LAB
Exercise Solutions
Part 1: Using The PRECHK Keyword
__ 1. Sign on using User ID and password.
__ 2. CRTSAVF FILE(OL51xx/OL51xxSAV1)
__ 3. SAVLIB LIB(OL51LIBSAV)
DEV(*SAVF)
SAVF(OL51xxSAV1)
OUTPUT(*PRINT)
__ 4. Message = 7 objects were saved; 1 objects was not saved.
__ 5. WRKSPLF, Option 5 on file QPSAVOBJ, page through the report. In the SAVED
column, you should see a NO for *FILE DATAFILE.
__ 6. CLRSAVF FILE(OL51xx/OL51xxSAV1)
__ 7. SAVLIB LIB(OL51LIBSAV)
DEV(*SAVF)
SAVF(OL51xxSAV1)
PRECHK(*YES)
You should get this message, Objects from library OL51LIBSAV not saved because
the save command could not lock all the objects in the library.
Part 2: Backing Up Your Lab Projects
__ 1. CLRSAVF FILE(OL51xx/OL51xxSAV1)
__ 2. SAVLIB LIB(OL51xx)
DEV(*SAVF)
SAVF(OL51xxSAV1)
PRECHK(*YES)
__ 3. DSPLIB LIB(OL51xx)
__ 4. DSPSAVF FILE(OL51xxSAV1)
END OF LAB
3-4 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
Exercise Instructions
CUSMSI is the file you will be journaling and BUILD is the program that will reference
OL51xx/CUSMSI.
The various journal commands in the following exercise may be executed in any of the
following ways:
• By keying the appropriate command
• By using the menu Journal Commands (GO CMDJRN, GO CMDJRNRCV)
• By using the WRKJRN (Work with Journals) command and from the resulting menu
selecting an appropriate option
Step 1: Initiating Journal Management
__ 1. Create a Journal Receiver, OL51xxR0001, in your team library OL51xx. Write the
command here:
_________________________________________________________________
__ 2. Create a Journal, named OL51xxJ, in your team library OL51xx and specify
OL51xxR0001 as the journal receiver. Write the command here:
_________________________________________________________________
__ 3. Issue the Start Journal Physical File command to start journaling the file
OL51xx/CUSMSI to your journal. Specify IMAGES(*BOTH). Write the used
command here:
_________________________________________________________________
__ 4. Use the Save Library command to save your library OL51xx to your save file
OL51xxSAV1. If you get a message saying that the save file already contains data,
take the G reply to Clear file and continue processing.
Note: If you did not create save file OL51xxSAV1 in the previous lab, do so now.
Write the used command(s) in the lines after.
_________________________________________________________________
_________________________________________________________________
__ 5. Use the Display Save File command to verify that the file was saved. Write the date
and time of the save here:
_________________________________________________________________
__ 6. Use the DSPJRN command to display your journal.
Key in a 5 for the MS (member saved) entry and press Enter.
See how the date and time show up under Entry-specific data.
4-2 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
4-4 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty f. Since you deleted the member between the last save and the restore, there is
a member deleted entry (journal code F, entry type MD) in the journal receiver
that will cause APYJRNCHG to terminate with an error message.
Display the journal. Is the sequence number of the F/MD entry for file CUSMSI the
same as you recorded above?
_________________________________________________________________
__ 4. This step will show you the number of journal entries applied by the APYJRNCHG
command.
a. Use the DSPJRN command (specify a receiver range that starts with your
first receiver, OL51xxR0001) to display your journal receiver entries. Use the
Help key on the CODE and TYPE fields.
b. The journal entry you recorded above should have been for a F/MD (member
deleted) entry. Starting at that entry, key in 5 for all the remaining entries and
press Enter.
c. Read the CODE and TYPE fields for each entry. Press Enter to move to the
next journal receiver entry. Keep doing this until you get to an entry that reads
Code F Type AY.
d. At the F/AY entry, find the COUNT/RRN field. (You may need to use F10 to
display the part of the journal receiver entry that has this field.) Move the
cursor to the COUNT/RRN field and press the Help key. Page forward until
you see F/AY and read the text.
e. While still at the F/AY entry, use the appropriate function key to display the
Entry Specific Data. The first ten columns contain the starting sequence
number and the next ten columns contain the ending sequence number of the
journal entries that the APYJRNCHG command used to update the CUSMSI
file. Now read these journal entries to see what journaled entries were
applied.
The entries that were applied recovered the changes you made to file CUSMSI. The
apply failed because you asked it to go past the F/MD entry.
__ 5. Print another listing of the file after recovery:
RUNQRY QRY(*NONE) QRYFILE(CUSMSI) OUTTYPE(*PRINTER)
Compare this listing to the listing you made before the disaster. They should be the
same.
END OF LAB
4-6 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
This program allows the user to perform file maintenance on a file named CUSMSI in the
team library OL51xx. When BUILD is called you will see this screen.
Customer Master File Maintenance
Enter Customer Number for Update & Delete, Enter all Information for Add
Enter Code Type, A=Add, D=Delete, U=Update: __
This program allows you to perform add, update, and delete operations on the file named
CUSMSI.
When you start the file contains the four records listed below.
Table 1:
CUSTOMER FILE LISTING - ABBREVIATED PAGE
4-8 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty TO ADD A NEW RECORD, key in a minimum of A for ADD and Customer Number. Key as
much of the additional information as you wish, to make the record meaningful:
Table 2:
Customer Master File Maintenance
Enter Customer Number for Update & Delete, Enter all Information for Add
Enter Code Type, A=Add, D=Delete, U=Update: A
Enter Customer Number for Update & Delete, Enter all Information for Add
Enter Code Type, A=Add, D=Delete, U=Update: D
The program then verifies that the customer number exists and asks, through the message
on the bottom of the screen, whether or not you really do wish to delete the record:
Table 4:
Customer Master File Maintenance
Enter Customer Number for Update & Delete, Enter all Information for Add
Enter Code Type, A=Add, D=Delete, U=Update: D
Confirm the displayed Customer Information & use Enter Key to Delete or
F5 not to Delete
Enter Customer Number for Update & Delete, Enter all Information for Add
Enter Code Type, A=Add, D=Delete, U=Update: U
4-10 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty The program then verifies that the customer number exists and shows the existing
information for that customer. Key any changes you wish to make and press Enter or F5 to
cancel the update.
Table 6:
Customer Master File Maintenance
Enter Customer Number for Update & Delete, Enter all Information for Add
Enter Code Type, A=Add, D=Delete, U=Update: U
You can update any field in this display including the customer number. For all of the
updates you do you will use the Enter key from this display.
Bottom
Command
===>__________________________________________________________________
F3=Exit F4=Prompt F9=Retrieve F12=Cancel
4-12 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
Bottom
F3=Exit F12=Cancel
4-14 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
Exercise Instructions
Getting Started
Sign on at your workstation, if you have not already done so, using your user name and
password:
User: OL51xx
Password OL51xx
In this lab you will be using a different version of the customer file, CUSMST, not CUSMSI.
Initially file CUSMST has the following valid customer numbers:
12345
23456
45678
63110
Step 1: Work with Journals
__ 1. Execute the Change Journal command and generate a new receiver. This will give
you a clean receiver for this lab.
_________________________________________________________________
__ 2. Issue the Start Journal Physical File command to start journaling the
OL51xx/CUSMST file to your journal. Specify IMAGES(*BOTH).
_________________________________________________________________
__ 3. Use the SAVLIB command to save your library, OL51xx, to your save file,
OL51xxSAV1. If you get an inquiry message saying that the save file already
contains data, take the G response.
__ 4. Use the Display Save File command and the Display Journal command to verify that
the file was saved.
__ 5. Start a commitment definition by executing the Start Commitment Control command.
Specify LCKLVL(*CHG).
_________________________________________________________________
__ 6. Call program BUILD. Specify Y for Commit and N for User Journal entries.
Perform the following operations:
a. Add a new customer to CUSMST.
Write the new number here: __________
Reply C for Commit.
b. Delete an existing customer record.
Write the new number here: __________
Reply C for Commit.
5-2 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty c. Update a customer record without changing the key field (customer number).
Write the new number here: __________
Reply C for Commit.
d. End the program using the F3 key.
__ 7. Issue the End Commitment Control command, ENDCMTCTL, to end your
commitment definition.
__ 8. Display your journal (DSPJRN) and answer the following questions:
a. What program caused the F/JM Journal Member entry?
_________________________________________________________________
b. What program caused the C/BC Start Commitment Control entry to occur?
_________________________________________________________________
c. What program caused the C/SC Start Commit Cycle entry to be made?
_________________________________________________________________
d. Examine the commit cycle ID field for all the journal entries in two commit
cycles. Notice when it changes. Compare the commit cycle ID to the journal
sequence numbers. From where does the commit cycle ID come?
_________________________________________________________________
e. What program caused the C/EC End Commitment Control entry?
_________________________________________________________________
Step 2: Forward Recovery
__ 1. Print a Query listing of your file OL51xx/CUSMST:
RUNQRY *N CUSMST *PRINTER
The file reflects the changes you made previously using the program BUILD under
commitment control.
__ 2. Delete file OL51xx/CUSMST. This simulates a failure that requires the file to be
rebuilt using forward recovery.
__ 3. Use the Display Journal command, DSPJRN, to find the range of entries that should
be applied. They will be bracketed by a C/BC (start commitment control) and a C/EC
(end commitment control) resulting from executing program BUILD under
commitment control.
Record those two sequence numbers here:
C/BC __________
C/EC __________
__ 4. Recover the file, either using the WRKJRN command or the RSTOBJ and
APYJRNCHG commands.
Apply Journaled Changes to your CUSMST file to bring it back to a point that
includes all the changes made previously.
_________________________________________________________________
__ 5. Display the journal and examine the last F/AY entry to see how many entries were
applied.
__ 6. Print a Query listing of OL51xx/CUSMST:
RUNQRY *N CUSMST *PRINTER
Compare this listing to the one you made before you deleted the file. They should be
the same.
Step 3: Backout Recovery and User Journal Entries
__ 1. Start another commit definition with the STRCMTCTL command.
__ 2. Call program BUILD.
Enter Y for commit and Y for user journal entries.
__ 3. Add a new record to the file.
Record the customer number: __________
Reply C for commit.
__ 4. Delete a record from the file.
Record the customer number: __________
Reply C for commit.
__ 5. End the program using F3.
__ 6. Display the journal and answer the following questions:
a. What is the sequence number of the code R, type PT, that did the add?
_________
b. What is the sequence number of the code R, type DL, that did the delete?
_______
c. What is the entry specific data for the user generated entries?
_________________________________________________________________
d. Were the user generated entries that occurred within a commit cycle given a
commit cycle ID?
_________________________________________________________________
5-4 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty __ 7. Execute the Remove Journaled Changes command, RMVJRNCHG, specifying the
sequence number of the R/PT Record Added for both the FROMENT and TOENT
parameter. Specify that commit boundaries should be honored: CMTBDY(*YES).
5-6 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty c. End your primary interactive job with *IMMED option. Type a 4 next to the job,
and prompt with F4 to do this.
__ 7. Verification of Roll Back of Uncommitted Changes:
Display your journal. Examine the journal entries that have been put in the journal as
a result of your recent activity against the file. Answer the following questions:
a. When the job was cancelled with the *IMMED option, what entries were put in
the journal?
_________________________________________________________________
b. Were these entries put there by BUILD or a system program?
_________________________________________________________________
c. Where did the entries get their commit cycle ID?
_________________________________________________________________
d. What is the purpose of the following entries:
R/DR _______________________________
R/UR _______________________________
R/BR _______________________________
__ 8. SIGNOFF, the lab exercise is ended.
END OF LAB
Exercise Solutions
The commands in this exercise may be executed in the following ways:
• Key the appropriate command on a command line.
• Use the menu Journal Commands (GO CMDJRN).
• Use the WRKJRN (Work with Journals) command and, from the resulting menu,
selecting an appropriate option.
Step 1 Work with Journals
__ 1. CHGJRN OL51xxJ *GEN
__ 2. STRJRNPF FILE(CUSMST) JRN(OL51xxJ) IMAGES(*BOTH)
__ 3. SAVLIB LIB(OL51xx) DEV(*SAVF) SAVF(OL51xxSAV1)
__ 4. DSPSAVF FILE(OL51xxSAV1)
DSPJRN JRN(OL51xxJ) should show a F/MS entries for files CUSMST and
CUSMSI.
__ 5. STRCMTCTL LCKLVL(*CHG)
__ 6. CALL BUILD. Respond Y N
__ 7. ENDCMTCTL
__ 8. To answer the questions for this step you must use the DSPJRN command to
display your journal entries. See next page:
5-8 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty
Display Journal Entries
a. Display the F/JM entry and find the value for the program field. The program that
caused the F/JM entry was QCMD.
b. The program should be BUILD. Though STRCMTCTL occurred before you called
BUILD, the C/BC entry was not put in the journal until the BUILD program ran.
c. The C/SC Start Commit entry was made by program BUILD. A C/SC entry is put in
the journal receiver when a program performs one the following to a file opened for
commitment control:
read a record for update
add a record
delete a record
d. Examination of a sequence of two commit cycles of journal entries, will show that the
commit cycle ID comes from the journal sequence number of the C/SC entry.
e. The program that caused the C/EC entry is QCMD.
5-10 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty
Table 10:
Display Journal Entries
Use Option 5 to display the F/AY entry for the CUSMST file. The Count field has the
number of entries applied and the entry specific data has the range of entries
applied.
__ 6. RUNQRY *N CUSMST *PRINTER
This listing and the one you printed before you deleted the file should show the
same records.
Step 3: Backout Recovery and User Journal Entries
1. STRCMTCTL LCKLVL(*CHG)
2. CALL BUILD (Y Y.)
3. Self-explanatory.
4. Self-explanatory.
5. Self-explanatory.
6. DSPJRN JRN(OL51xx/OL51xxJ)
Table 11:
Display Journal Entries
a. In this example the sequence number that did the add is '100'.
b. In this example the sequence number that did the delete is'105'.
c. The entry specific data for the user generated entries includes the operation type
(such as ADD) and the customer number.
d. No, the commit cycle ID is 0 for user entries.
7. RMVJRNCHG JRN(OL51xxJ/OL51xx)
FILE(CUSMST)
RCVRNG(OL51xxR0002)
FROMENT(100)
TOENT(100)
CMTBDY(*YES)
The message you will receive is:
FROMENT option not valid. Commit boundary violation.
8. RMVJRNCHG JRN(OL51xxJ/OL51xx)
FILE(CUSMST)
RCVRNG(OL51xxR0002)
FROMENT(102)
TOENT(98)
5-12 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty CMTBDY(*YES)
The system will give you the following message:
1 entries removed from member CUSMST.
Step 4: Immediate Termination in a Commit Cycle
1. CALL OL51xx/BUILD (Y Y)
2. Committed Add, Update, Delete
Self-explanatory.
3. Rolled Back Add, Update, Delete
Self-explanatory
4. Examination of Job Using the System Request Function
Table 12:
Display Commitment Control Status
System: STL 40DEV1
Job: DSPxx User: OL51xx Number: 001131
Commitment
Opt Definition Description
5 *DFTACTGRP Default activation group
Bottom
Press Enter to continue.
Table 13:
Display Commitment Definition Status STL
01/12/95 18:09:3040DEV1
Job: DSPxx User: OL51xx Number: 001131
--------------------------------------------------------------
| Display Resource Status |
| |
| Type option, press Enter. |
| 1=Select |
| |
| Opt Resource |
| -- Record level |
| -- Object level |
| -- Conversation |
| -- Remote file |
| -- Remote RDB |
| -- API | Bottom
| Bottom |
|F5=Refresh F12=Cancel |
--------------------------------------------------------------
5-14 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
-------------Changes--------------
File Library Member Commit Rollback Pending
CUSMST OL51xx CUSMST 3 3 0
Bottom
Press Enter to continue.
The file that has all the changes is CUSMST, and there are no pending changes.
-------------Changes--------------
File Library Member Commit Rollback Pending
CUSMST OL51xx CUSMST 3 3 1
Bottom
Press Enter to continue.
5-16 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty From the Display Job menu, using Option 12 (Display Locks, if active), you will get the
following screen:
Table 17:
Display Job Locks
Object Member
Opt Object Library Type Lock Status Locks
CUSMST OL51xx *FILE-PHY *SHRRD HELD YES
DSPxx QSYS *DEVD *EXCLRD HELD
*EXCLRD HELD
*EXCLRD HELD
*EXCLRD HELD
*EXCLRD HELD
*EXCLRD
*EXCLRD
MAINT OL51LIB *FILE-DSP *SHRNUP HELD
QCBL QSYS *LIB *SHRRD
More...
As you can see you have a member lock on the file CUSMST.
6. Abnormal End of a Job with Automatic Rollback
Self explanatory.
7. Verification of Roll Back of Uncommitted Changes. See next page:
DSPJRN OL51xxJ
Table 18:
Display Journal Entries
5-18 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty a.
Table 19:
Display Journal Entries
b. The entries were put in the journal by a system program. The program name starts
with a letter Q.
c. The entries put in the journal as a result of the job being cancelled all have the same
commit cycle ID. This commit cycle ID comes from the C/SC at the beginning of the
commit cycle.
Table 20:
Display Entire Journal Entry
END OF LAB
5-20 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
Exercise Instructions
Step 1: Use the Copy Screen Image facility
__ 1. Sign on to the system, using your OL51xx user ID and password.
__ 2. From the AS/400 Main Menu, use menu navigation to arrive at the Copy Screen
Commands menu (problem handling - more problem handling options - copy screen
image).
Coordinate the next several steps with a team at a display station near you.
__ 3. One team should execute the Start Copy Screen command, specifying the second
team's display as the source device. Output device is *REQUESTER.
__ 4. The second team should answer the break message that arrives.
__ 5. The second team should execute various commands, and both teams should
observe the activity that results. You should attempt to simulate a problem handling
scenario, in which the second team is having a problem, and the first team is
providing direction and help.
__ 6. The first team should attempt to key a command in order to verify their inability to do
so.
__ 7. When you have exercised the scenario sufficiently, the second team should end
copy screen by SIGNOFF or execution of the End Copy Screen command.
__ 8. These steps should be repeated, with the teams reversing rolls. After both teams
have performed all the functions involved with Copy Screen Image, each team
should continue with the lab.
Step 2: Display and change attributes of an active job
__ 1. Sign on to the system, using your user ID and password, if you have not yet done
so.
__ 2. Go to the USER TASKS menu and select the option to display or change your job.
Record:
Job name _______
User name _______
Job number_______
__ 3. Select the option to display status attributes. Record the following items:
Status _______
Subsystem _______
Pool ID _______
Type of job _______
__ 4. Press Enter to return to the Work with Job display, and then select the option to
display your job's definition attributes.
6-2 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
EXempty Notice the date format used by your job. You are going to change this, in a moment.
Record job date
From this display use the function key which will allow you to change your job.
__ 5. Change the run priority for your job to 15. Do not press Enter. What effect will this
change have? __________________________________________________
__ 6. Change the date format for your job. The prompt for this does not appear on the first
screen. You must use a function key to display additional parameters and then roll to
the next screen.
When you see the prompt for the date format, change the value so that a Julian date
is used (hint: Use the HELP facility to find out the correct value to key).
Press Enter, and your job will be changed.
__ 7. Return to the Work with Job display and then display your job's definition attributes.
Record the new job date: _________ and format _________
__ 8. Return to the Work with Job screen and then display your job's run attributes.
What is the run priority? ________
How many milliseconds of CPU time has your job used? _______
How much temporary storage has your job used? _______
Return to the USER TASKS menu.
Step 3: Create and view a spool file
__ 1. Key the command DSPLIB OL51xx *PRINT, where xx is your team number, and
press Enter. The DSPLIB command will execute and your output will be spooled.
__ 2. From the USER TASKS menu take the option to work with your spooled files.
What is the file name of your spooled output? _______
Select the option to display your spool file.
What is the size of your library in bytes? _______
Return to the USER TASKS menu.
Step 4: Display the job log for a batch job
__ 1. From the USER TASKS menu take the option to submit a job. The Submit Job
display will be presented.
__ 2. On the Command to run prompt, key the command DSPLIB OL51xx, where xx is
your team number. Do not press Enter. Specify a job name of LAB7xx, where xx is
your team number. Use the appropriate function key to display additional
parameters and insure that the job will be HELD ON THE JOB QUEUE. You will
need to roll forward two pages to find the prompt screen with the correct parameter.
Specify message logging text of *SECLVL. This will cause the job log to be written to
a spool file.
6-4 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Exercises
6-6 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V3.0
backpg
Back page
®