AS400 Material by Praveen - CL Dasa

9
HIGH PRIORITY QUESTIONS 1. Usage of OVRDBF command 2. How to debug a batch Job? 3. Level Check Error? 4. DSPFD 5. DSPDBR 6. WRKOBJ or DSPOBJD (*service) 7. DSPFFD 8. DSPPGMREF 9. What is a Job? What are the different types of Jobs? 10. WRKSBMJOB 11. WRKACTJOB 12. WRKJOBQ 13. Parameter passing techniques or Inter program communication methods 14. Usage of PGM & ENDPGM commands? 15. Access path maintenance techniques 16. Difference between Access path & ODP? 17. DSPFFM 18. Difference between RGZPFM & REUSEDLT(*YES) 19. RCVF, SNDF,SNDRCVF 20. CHGPF 21. Differences between Logical File & Open Query File? 22. Open Query File Steps? 23. Exceptional Handling in CL ( MONMSG) 24. Difference between CALL & TFRCTL commands 25. Subsystem & Subsystem Description 26. Data area Data Queue usage 27. Difference between *CAT, *BCAT *TCAT 28. Types of Logical Files 29. Difference between Physical File & Field Reference File? CL Definition: - CL is the set of system commands, with which the user makes a request to the system to perform the required function. CL programs provide a vehicle for communication between the user and the machine. Object, Why AS/400 is called as Object based architecture? Library Repository of Objects Library List – What is a Job? What are the different types of Jobs? Job – Every piece of work that runs in a subsystem is called a job Interactive Job, batch job 1

description

hello

Transcript of AS400 Material by Praveen - CL Dasa

Page 1: AS400 Material by Praveen - CL Dasa

HIGH PRIORITY QUESTIONS

1. Usage of OVRDBF command2. How to debug a batch Job?3. Level Check Error?4. DSPFD5. DSPDBR6. WRKOBJ or DSPOBJD (*service)7. DSPFFD8. DSPPGMREF9. What is a Job? What are the different types of Jobs?10. WRKSBMJOB11. WRKACTJOB12. WRKJOBQ13. Parameter passing techniques or Inter program communication methods14. Usage of PGM & ENDPGM commands?15. Access path maintenance techniques16. Difference between Access path & ODP?17. DSPFFM18. Difference between RGZPFM & REUSEDLT(*YES)19. RCVF, SNDF,SNDRCVF20. CHGPF21. Differences between Logical File & Open Query File?22. Open Query File Steps?23. Exceptional Handling in CL ( MONMSG) 24. Difference between CALL & TFRCTL commands25. Subsystem & Subsystem Description26. Data area Data Queue usage27. Difference between *CAT, *BCAT *TCAT28. Types of Logical Files 29. Difference between Physical File & Field Reference File?

CL Definition: - CL is the set of system commands, with which the user makes a request to the system to perform the required function.CL programs provide a vehicle for communication between the user and the machine.

Object, Why AS/400 is called as Object based architecture?Library – Repository of ObjectsLibrary List –

What is a Job? What are the different types of Jobs?Job – Every piece of work that runs in a subsystem is called a jobInteractive Job, batch jobBatch job is a predefined sequence of processes submitted to the job queue to be performed with out any interactions from the use.

What is Job queue?It consists of a list of batch jobs waiting to be processed.Default Job queue – QBATCH

1

Page 2: AS400 Material by Praveen - CL Dasa

What is Subsystem?Subsystem is an environment we setup for interactive jobs. You can always create a subsystem whose attributes determine how work is to be done under that particular environment.The subsystem is defined by the subsystem description. The subsystem description contains information defining how the operating environment will be controlled by the system.

In brief a Sub system is a logical division of the main memory. It is setup by establishing a set of parameters that control the running environment of the system.

CRTSBS, CRTSBSD

What is Output Queue?Output queue is a place to store output files produced by a program

What is a Message Queue?The Message Queue is a place to store the messages sent between users, between jobs, between programs, between user and program and so forth…

Batch Job InformationA batch job is opposite to an interactive job and is created on the AS/400 by the SBMJOB command or BCHJOB commands. Every batch job submitted lines up in the job queue to wait for its turn to be run.

In how many ways can u submit a batch job? A batch job can be submitted by an interactive job or from another batch job.Like, u can use SBMJOB command to submit the compilation job by batch. Or on the other hand you can use CRTCLPGM command at the system command line for interactive compilation.

How to know the current status of the batch job that u submitted? What are the possible statuses?

With the help of the WRKSBMJOB command we can find out the current status of the batch job that we submitted.

The possible statuses areJOBQ – The Job is successfully submitted and is still in the Job Queue waiting for its turn for execution.ACTIVE – The Job is runningOUTQ – The Job was ended and its output has been written to spool files in an out queue.

If the job is successfully submitted to the Job Queue, the system should return a message to you that indicate the assigned Job name, and also the job queue the job is waiting at.

By default we submit our compilation job to a job queue name QBATCH in library QGPL. We can check the current status of the job queue using the WRKJOBQ command.

The WRKJOBQ command displays all the jobs waiting in the named job queue and their current job status as well.

2

Page 3: AS400 Material by Praveen - CL Dasa

The possible statuses are HLD – The Job has been put on holdRLS – The job is released from the on hold position and is ready to run

Sometimes you may find that there are too many jobs submitted to the same job queueThen you may want to throw your job to another job queue that is not that busy. To change the job queue you must have *JOBCTL authority for your user profile.

How will you get the statistics of all the active jobs on the system

WRKACTJOB command is used to display the statistics of all the active jobs on the system.This command displays all the jobs running on the system including batch jobs, interactive jobs, communication jobs, spooling jobs etc.

Opt Subsystem/Job

User Type CPU % Function Status

- DFQ120102 Ramu INT 4.4 PGM-PGM001

DEQW

- IB1010 Ramana BCH 2.1 CMD-SBMJOB

RUN

- Rq1019 Ram WTR 0.4 PGM-STP01

DEQW

- QPGMR QSYS SBS .01 DEQWInteractive JobBatch Job

WRKSYSSTS – It gives you information about the current status of the system.Ex: -

No of Jobs currently on the system Capacity of auxiliary storage Percentage of system storage in use Amount of temporary storage in use Statistical information about each storage pool ( system pool, reserved pool

etc)

WRKCFGSTS – It displays the status information for communication lines, controllers, devices, network interfaces and any jobs associated with these devices.

WRKDSKSTS – It lets u work with the disk activity status and storage levels.

DSPSYSVAL – To find out the general system information of ur AS/400 machine

Types of String Operators:-

1) Concatenation Operator ( *CAT or || )2) Blank Concatenation Operator ( *BCAT or |> )3) Trailing Concatenation Operator ( *TCAT or |< )

The Concatenation operator would just join 2 strings as they are and create a result that includes all characters in both strings including the leading blanks, trailing blanks & embedded blanks.

3

Page 4: AS400 Material by Praveen - CL Dasa

The Blank concatenation operator would strip off the trailing blanks of the first string and insert one blank space between the 1st string & the 2nd second string. If there are any leading blanks in the second string they would be included as well. If there are any trailing blanks in the 1st string they would be eliminated.

The Trailing concatenation operator would strip off the trailing blanks of the 1st string and join the 2nd string as it is.

How many types of control flow statements are there in CL?

1) Conditional branching (IF – THEN – ELSE)2) Un conditional branching ( GOTO + LABEL)

What is the difference between CALL & TFRCTL command?

The CALL command in the CL program starts the execution of another program, and it puts the called program on the program stack of the current job where as the Transfer control command passes control to the called program and after control is passes successfully, it removes itself from the program stack.

What are the different types of authorities that you can set when you create a library?

CRTLIB <F4> authority ---- ( *ALL, *CHANGE, *USE, *EXCLUDE)Object Authority

Operational Authority

Management Authority

Existence Authority

Data Management Authority

*ALL Yes Yes Yes Read, Add, Update, Delete

*CHANGE Yes - - Read, Add, Update, Delete

*USE Yes - - Read Only*EXCLUDE No No No No

What is a Library List & what are the different parts of the Library List?

Library list – Library list is a list that indicates which libraries are to be searched and the order in which they are to be searched for an object.The different parts of library list are

System Libraries or System Part ( System Commands, Programs & Other program objects needed for system tasks)

Production Libraries ( to support system utilities max 2 in A library list )

Current Library ( it is the library where created object is Placed, if no current library is specified then QGPL)

User Library ( Our libraries)

QSYSQSYS2QUSRSYSQHLPSYSZ1SYZ2SYQGPLRamuRamanaRam Kumar

4

Page 5: AS400 Material by Praveen - CL Dasa

What is the syntax of the submit job command?

SBMJOB CMD (call program (program-name)) job (jobname) OUTQ (output queue)If the job is submitted successfully to the job queue, the system returns with a message that the batch job with job number.

How to find out the Job name, User name & job number of a batch job?

By using RTVJOBA command

PGM DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)DCL VAR(&USER) TYPE(*CHAR) LEN(10)DCL VAR(&JOBNUM) TYPE(*CHAR) LEN(10)...RTVJOBA JOB(&JOBNAME) USER(&USER) NBR(&JOBNUM)...ENDPGM

What is Job Description?

A Job Description is a collection of parameters that control the job when it is started in a subsystem. Every Job to be started on a system must use a job description.CRTJOBD <F4> Job Queue - (Job Queue parameter is the name of the defined job queue in which the job will be placed if it is a batch job)Note:- WRKJOBQ <job queue name) – the display would include the following Column 1 – Option for user inputColumn 2 – Job nameColumn 3 – User nameColumn 4 – Job numberColumn 5 – Job priorityColumn 6 – Job Status

Column 5 is the priority of the jobs, & this priority determines which job would go into the storage pool for execution. Priority 1 is the highest priority. You can change the job priority of the batch job by using the CHGJOB command if you have Job Control special authority.JOBPTY, OUTPTY, CHGJOBD.

Sub system & sub system descriptions:-

For definition see above.There are a whole set of attributes associated with each subsystem. These attributes are called as Subsystem descriptions. Definition: - Sub system descriptions are a specific type of object on AS/400 system; they define how jobs are run in that particular system.

5

Page 6: AS400 Material by Praveen - CL Dasa

The attributes include:-1. Operational Attributes like max no of jobs allowed in a subsystem2. Pool definitions – which designate which system storage pool to use

And many moreCRTSBSD is the command to create a sub system description; Ex:- CRTSBSD SBSD( library/subsystem description) POOLS(( 4 1000 3) (2 1000 1) ) MAXJOBS(3)To display pool definition WRKSBS

The activity level for a pool specifies the maximum number of jobs that can run at the same time in that storage pool.

Once the sub system is created; it can be started with STRSBS commandEX:- STRSBS SBSD( library / sub system description)

To end the subsystem, use ENDSBS commandEX:- ENDSBS SBSD( library / sub system description)You can always change the sub system descriptions using the CHGSBSD command.

What is a Storage pool?On the AS/400 the main storage can be divided into logical allocations called storage pools.

1. Machine Storage pool2. Base Storage pool3. remaining allocated for active subsystems

System pool with identifier 1 is called as machine storage pool which is used for machine & operating system programs. No other user jobs would run in this pool. To determine pool sizeDSPSYSVAL SYSVAL (QMCHPOOL)System pool with identifier 2 is always a base storage pool. This storage pool is mostly used for running batch jobs & other operating system functionsDSPSYSVAL SYSVAL (QBASPOOL)System pools with identifiers 3, 4, 5 ….. are allocated for active subsystems and as many as 14 such additional storage pools can be allocated.Each storage pool has a size & activity level. The activity level determines the maximum number of jobs that can share the pool at any time.

Communication between programs:- 1. Parameter – Advantages & disadvantages 2. Data Area – Advantages & Disadvantages3. Message - Advantages & Disadvantages4. Data Queue - 5. Switch – 6. Database File

For each job running on AS/400, whether or not it is an interactive job or a batch job there are 8 switches associated with each job. It’s value is either 0 or 1 You can find out the switch setting for your current job by using DSPJOB command & can change the switch setting by using CHGJOB command provided you have authority.

Parameter

Stored in Main memory Sender & receiver programs must be on the same program stack

Data Local Data Area stored in Receiver program must be submitted by

Pool ID

Storage Size (K)

Activity Level

2 1000 14 1000 3

6

Page 7: AS400 Material by Praveen - CL Dasa

Area main memory & permanent data area stored on disk

the sender program if using Local data area, otherwise they do not need to be in the same job

Messages

Some stored in main memory and some stored in disk depending on the type of message queue

Receiver Program & the sender program must be in the same job if using program *PGMQ otherwise they do not need to be in the same job (*mSGQ)

Data Queue

Stored on disk Sender & receiver do not need to be in the same job

Switches Stored in main memory Sender & receiver need to be in the same job

What are the different types of messages that you can send using SNDPGMMSG?

1. Informational message2. Inquiry message3. Request message4. Completion message5. Diagnostic message6. Notify message7. Escape message8. Status message

7