Академический Документы
Профессиональный Документы
Культура Документы
• Parameters
• Data Queue
• Data Area
Data queues are a type of system object that you can create, to which
one HLL
procedure or program can send data, and from which another HLL
procedure or
program can receive data. The receiving program can be already
waiting for the
data, or can receive the data later.
• When receiving data from a data queue, you can set a time out
such that the job waits until an entry arrives on the data queue.
This differs from using the EOFDLY parameter on the OVRDBF
command, which causes the job to be activated whenever the
delay time ends.
• More than one job can receive data from the same data queue.
This has an
advantage in certain applications where the number of entries to
be processed is greater than one job can handle within the desired
performance restraints. For example, if several printers are
available to print orders, several interactive jobs could send
requests to a single data queue. A separate job for each printer
could receive from the data queue, either in first-in-first-out
(FIFO), last-in-first-out (LIFO), or in keyed-queue order.
A data area is an object used to hold data for access by any job
running on the system. A data area can be used whenever you need
to store information of limited size, independent of the existence of
procedures or files. Typical uses of data areas are:
A local data area is created for each job in the system, including
autostart jobs, jobs started on the system by a reader, and
subsystem monitor jobs. The system creates a local data area,
which is initially filled with blanks, with a length of 1024 and type
*CHAR. When you submit a job using the SBMJOB command, the
value of the submitting job’s local data area is copied into the
submitted job’s local data area. You can refer to your job’s local
data area by specifying *LDA for the DTAARA keyword on the
CHGDTAARA, RTVDTAARA, and DSPDTAARA commands or *LDA for
the substring built-in function (%SST).
The following is true of a local data area:
• The local data area cannot be referred to from any other job.
• You cannot create, delete, or allocate a local data area.
• No library is associated with the local data area.
• You cannot change the local data area in a secondary thread.
• The ILE CL compiler generates code to ensure that a procedure
running in a secondary thread cannot access the local data
area while a procedure running in the initial thread is
changing it.
A PIP data area (PDA) is created for each prestart job when the
job is started. The object sub-type of the PDA is different than a
regular data area. The PDA can only be referred to by the special
value name *PDA. The size of the PDA is 2000 bytes but the
number of parameters contained in it is not restricted. The
RTVDTAARA, CHGDTAARA, and DSPDTAARA CL commands and the
RTVDTAARA and CHGDTAARA macro instructions support the
special value *PDA for the data area name parameter.
4. Remote Data Area :-
You can access remote data areas by using Distributed Data
Management (DDM). You do not need to change or recompile an
application program that resides on one AS/400 when it retrieves
data that resides on a remote AS/400. To ensure that you are
accessing the correct data area, you may need to do one of the
following:
• Delete the standard data area and create a DDM data
area that has the same name as the original standard data
area
• Rename the standard data area
7. What is the difference between a batch job and interactive
job?
When you are signed on the system, you type one request at a
time (such as selecting an option or typing a command) and the system
responds to each request as it is typed. This session, sometimes called
an interactive job, begins when you sign on a display station and ends
when you sign off. During the session, your interaction with the system
is similar to a conversation. The AS/400 system links together all of the
tasks you do from the time you sign on until you sign off. This makes it
easier for you to manage your work environment, find your output, and
keep track of what you have done.
8. What is Override ?
16. If you are calling pgm PGMB from PGMA and the
command SNDPGMMSG is encountered in PGMB where will
the msg go? [*MSGQ]
Message is the interface between operating system and the programs or user and program. We can
classify the message into two types namely
Immediate message
Predefined message
Immediate message
Which does the program or system user create when they are sent and are not
permanently stored in the system?
Control language
SNDUSRMSG
SNDPGMMSG
SNDMSG
SNDBRKMSG
Display files
ERRMSG
SFLMSG
INQUIRY and INFORMATIONAL message:
Using SNDUSRMSG command to send type of message
Predefined message
Which are created before they are used. These messages are placed in a message file
(queue) when they are created, and retrieved from the file when they are used.
Control language
SNDUSRMSG
SNDPGMMSG
RTVMSG
Display files
ERRMSGID
SFLMSGID
MSGCON
MSGID
COMPLETION and DIAGNOSTIC message
Using SNDPGMMSG command these of message can be sent to any message
queue.
DIAGNOSTIC message tell the calling program about errors detected by the
program. Completion message tell the result of work done by the program.
STATUS messages
Using SNDPGMMSG command status message can be sent to it’s caller’s
program message queue or to the external message queue for the job. These message tell
the receiving program the status of the work performed by the sending program.
ESCAPE message
Using SNDPGMMSG command escape message from a CL program can be sent
to it’s calling program. An escape message tells the calling program ended abnormally
and why.
NOTTFY message
Notify message from a CL program can be sent to the message queue of calling
program or to the external message queue. A notify message tells the calling program
about a condition under which processing can continue.
Predefined message are stored in message file
To create a message file
CRTMSGF MSGF (MFILE) SIZE () AUT() TEXT ()
Create and maintain messages
ADDMSGD
CHGMSGD OR WRKMSGD
DSPMSGD
RMVMSGD
Message file QCPFMSG in library QSYS contain the system message
%RANGE
It will fetch the records within the specific range
QRYSLT (‘EMPNO *Eq %RANGE (100 110)’)
CALL PGM (LIB/NAME) PARM ()
DLTOVR
As we see early the main file logically overridden and after performing the
necessary operation, we have to delete the logical file so that the main file
contains the actual records for this DLTOVR will be used.
DLTOVR FILE (OPNPF)
CLOF
We have to close the file, which has been opened
CLOF OPNID (OPNPF)
You will copy overridden file records using CPYFRMQRYF
CPYFRMQRYF
Since OVRDBF is logical we cannot able to list the variables, which satisfy the
query condition. To see the records being selected we have to copy from the
source file to a temporary file for this CPYFRMQRYF will be used
CPYFRMQRYF FROMOPNID (OPNPF) TOFILE (LIB/NAME) MBR
(*REPLACE) CRTFILE (*YES) FMTOPT (*NOCHK)
RUNQRY
We have copied the contents satisfy the query into a temporary file using
CPYFRMQRYF. If we run the destination file we got the actual records, which
satisfy the query.
RUNQRY QRYFILE (LIN/NAME)