Session 6
Session 6
Session 6
11/09/2K14
REVISION
Q1. How we know the user to which we are signed in ?
DSPJOB- To find the user to which we are logged into
Q2. ERROR - CPF1113 Library in the initial library list not found.
Anyone of the libraries in the initial library list is not present.
Always create a job description in the user defined library. Shift F2 will give the command
string that has been used before……
There are two kinds of entry restriction from signing on from two different sessions.
DSPWSUSR – to display all the jobs.
EDTOBJAUT – To restrict others from access
SYNTAX:
Chgusrprf <user name>
Another way
Sign in >tfrsecjob>sign out>again sign in>
To find the system model
WRKSYSVAL QMODEL
Result :
The system model is 150
To find the type
DSPHDWSRC *PRC
Result:
The system type is 9401 – xxxx.
Assistance is three kinds that describes the way we view in the screen…. The
assistance could be 3 levels.
System operator message queue is the most important message queue. Because all server
messages related to health and status of the server are received here. T
DSPMSG QSYSOPR – TO FIND THE HEALTH AND STATUS OF THE SERVER. (OR)
DSPMSG *SYSOPR.
WORKACTJOB can be used to get the work station ID.
DSPOBJD is equivalent is properties in windows. TO know the source member, library
associated with the (PGM) object use SERVICE in DETAIL.
When keywords are used then its KEYWORD (value) , then it called keyword format.
F11 – used to find the various keywords present for a particular parameter. Even if two
object types are given in the single command then it will execute.In keyword format it can
be given in any way . The second or positional format the objects types should not be
changed
DSPJOBD obj($$$$/****) objtype(*pgm) – keyword format
DSPJOB $$$$/**** *pgm – positional format.
Session – 8
12/09/2K13
QSYS and QGPL are the two most important libraries in the library list
To display software application list:
DSPSFWSRC (or) GO LICPGM and use option 10
In case of error in the program give sp(give that in the option) – that is equi. To work with
spool files (wrkspl). Get into the program to find any errors present in the program. Press
shift F6 to take you to the last set of spool files. Then display the spool file (spool file name
is the same as that of the program name) to read and to find errors. When we
code cl programs it must start with pgm and end with endpgm. It becomes mandatory when
we pass parameters. Even on successful compilation of the program when we check the
spool file it shows errors of severity of level 10 , who can simply be ignored as it doesn’t has
any effect.
DB2
4.AS/400 DATABASE
(4.4)DDM –Distributed Database Management.
SAVLIB can be used to backup to tape. Only a single library can be backed up to a
save file. To create a save fileCRTSAVF and then prompt accordingly giving the save file,
library and object type. Save file is synonymous to disk file. That is using SAVLIB the
particular library is backed up into the save file created by the user. The same file can also be
FTP ed on to the pc and be backed up on to the pendrive. But where it can opened due to
void AS/400 environment.
DDS – Data Description Specification
(4.5)
Physical file – An object that stores data. Associated to the physical file a logical file can be
had that is analogous to theview in the databases. Examples of logical files: A view cant
contain data but it is dependent on the physical file. An index helps in faster retrieval of
data. Logical files can be used to work with the data present in the physical file.
SDA – Screen Design Aid can be used to design display files and menus. The screen that
appears is called the DISPLAY FILE. Also DDS is fixed format language using which physical
files , logical files , display files and printer files and menus can be designed. This language is
evolved from the punched cards system used in earlier computing systems.
SDA coding =_ RLU coding that will generate DDS coding.
When any program Is coded by SDA the result is specified in a format called printer
file coded by Report Layout Utility (RLU). In RPG program we specify the display file and
printer file. If no display file is used only a message will we thrown. SDA helps in interactive
display .The printer file is designed to provide the summary of the result.
Any programming could be made in CL programs, RPG 400, RPG-IV (ILE). A CL
program can call RPG program (similar to call by value)
Exampl:
EMPPROG
Pgm
If op ==1
Call empadd
/*emp add has a separate display file and so does other programs*/
If op== 2
Call empdel
If op==3
Call empmod.
Endpgm
Where empadd,empdel,empmod are RPG sub programs. They can also be CL sub
programs.
DATA updates through the logical file to the physical file.CL always is used as a
driver program. RPG can be of fixed or free.CL can’t do complex work such as database
processing.
The various components
Database (Physical files and logical Files)
Display files
Printer files
Program
N.B: FOR ANY ASSISTANCE AND DOUBTS _support@itci.co.in
Database could be designed by either SQL or DDS. SQL is an open standard whereas DDS
helps in working with DB2 only on the AS/400 platform.
Differences between SQL and DDS
TABLE PHYSICAL FILE
VIEW LOGICAL FILE
COLUMN FIELD
ROW RECORD
INDEX LOGICAL FILE (KEY FIELD which designated
the logical file as index)
AGENDA
Physical file - *PF
Logical file - *LF
Field reference file- *PF .It is also a physical file but advisable to insert into the Field
Reference File. It can contain data.
LAB HANDS ON
To work with DDS we need to create a source physical file(QDDSSRC). Book written by Brian
Meyers “What you can do with RPG” to refer naming conventions. DDS can be used to
create physical file , logical file, printer file , display file ,menu. DDS is a fixed format column
oriented. Physical contains only a single record format.
By default the data type would be alphanumeric.
Create source physical file
CRTSRCPF QDDSSRC (F4)
Library CTS15LIB
>Get into the source physical file
STRPDM (enter)
>Press 3 to Work with members.
>give in the name as EMP and Member type as pf ////FILE TYPE(*FILE)(member
type is the attribute)
Press F6.
Once the member is created
Prompt straightaway to enter the table name and return type(refer notebook)
Enter the fields specifying the name , data type , length.. save the cl program and
exit.
STRDFU
Enter the data file as emp and the library.
Press enter and enter the details of every record.evrytime press a down arrow and then
press enter.At the last entry press down arrow and then press F3. Save the entry in the
table and exit.
To modify
STRDFU
option5
Enter the number of the record to be modified
To delete
Runqry *n Emp
F23
When any physical file with data is recompiled the entire data will be erased.
To make a structural change without any loss in data
DSPFD
DSPFD <filename>
To display the file description
DSPFFD
DSPFFD <filename>
To display the file field description
Displays the fields present in the physical file
DSPDBR/DSPPGMREF.
To add new field
Procedure
STRPDM
Option3
At the last program line give ip and then press ENTER
Enter the new field.
To prevent data loss on recompilation (DO BEFORE COMPILATION and do not recompile at
any instant)
CHGPF (F4) (to bring structural modification without any loss in data)
Enter The Library And Source File
DSPFFD <db> (to find fields in the file)
Runqry *n emp
The functions here are described as field level keywords. They may be record level , file
level, key field
Functions example
1.Colhdg(‘employee number’)
Output
Empno will be displayed as EMPLOYEE NUMBER
2.Colhdg(‘Employee’ ‘number’)
Output
Employee
Number /*on running the query*/
To design a logical file
Strpdm(work with member and create a member)
Give the type as empl (member type lf).
N.B: If the record format in the logical file and the associated physical file is same and if no
additional fields are specified in the logical file then logical file maps to all the records in
the physical file. But if record format is different you have to explicitly specify the field
names.
Give the record format and prompt . In the function specify PFILE (library/physical
file).
Where logical file maps onto to the physical file stated in the record format level
keyword(The function).
DSPDBR – display database relations ( to know the logical files mapped onto a single physical
file)
Enter the physical files and the corresponding library.