As400 Faqs
As400 Faqs
As400 Faqs
2. What is the difference between array and a multiple occurrence data structure?
The values stored in array don’t vary. In the other hand, we can store the
Different values in same variables at various stages.
4. How can you execute a command from within an RPG program without calling a CLP
program?
By calling QCMDEXC application program interface we can execute a CL command with in an
RPG program.
If you specify 'N' in 53rd position, the record will not be locked if you try to read the locked
record. It is a way of avoiding the record lock.
6. Which of the following operations does NOT zero the field FLDA defined as 4,0?
7. How can you check for a records existence without causing and I/O (CHAIN/READ)?
With the help of File Information Data Structure, we can check existence of records in a physical
file. The code is described below:
In File description continuation line (IPFK),
KINFDS RCDS
IRCDS DS
I *RECORD #RCDS
with the above code we can check the existence of records in a file without causing I/O
operation.
8. Define what a data area is along with a brief example of what it may be used for?
9. Define what a data queue is along with a brief example of what it may be used for?
Data queues provides communication between programs by calling API's QSNDDTAQ and
QRCVDTAQ along with parameters like data queue name, library in which data queue exists,
variable to store the number of characters to be sent. We can send the same data queue to the
many programs.
I 'CLOSED' C STAT01
I 'OPEN' C STAT02
It is a type of initializing the variables in I-spec. and these are further used in C-spec.
RCVF command used to receive the records either from the data base file or device file.
DOWxx : If the condition becomes true, then only the group of instructions allowed executing.
DOUxx : Irrespective of condition, it will execute at least one time.
If you specify LEAVE, the control transfers to the statement below the ENDDO.
If you specify the ITER, the groups of statements are allowed to execute repeatedly.
FORDHDR1 IF E K DISK
ORDHDRF KRENAMEORDHDRF1
C/COPY QRPGSRC,ORDERR
During the compilation the source code of ORDERR copy book is copied into the
existing program. Where as /COPY is compiler directive statement.
FORDHDR1 CF E WORKSTN
$2SFN SFILE FMT2
The above line indicates that, $2SFN is a relative record number and FMT2 is name of the
subfile record format.
I UDS
I 1 60ORDER#
I 7 90LINE#
The purpose is to define the variables in I-Spec and these are further used in C-spec. Where as
‘U’ indicates data area data structure? The above code is used to update the data area
value through the program. The letter "U" indicates that the defined data structure is a data
area data structure.
28.Define what the operation will do, the purpose of the result field and the purpose of
*IN66?
HI LO EQ
C CALL 'CVTDAT' DTPRM 66
The above statement causes, call the program and pass the parameter.
30.Define the purpose of the following code (If you know, how would this be written in RPG
ILE)
HI LO EQ
C *IN66 DOUEQ *OFF
C KEY1 CHAIN FILEA 90 66
C 66 CALL PGM1 PRM
C ENDDO
Whenever the indicator *IN66 becomes *OFF, the control transfers after ENDDO statement.
Otherwise, it reads the records from the data base file based on indicator specified on HI
position. If the specified indicator on LO position becomes *OFF, then only CALL statement will
execute.
31.How do you set the keywords SFLSIZ and SFLPAG if you want the subfile to dynamically
expand?
It is the most desirable method in building a real time applications. We can use at all the
times.
34.How can you detect overflow for a print program that prints multiple lines per cycle?
You specify the indicators OA through OG and OV in 33 - 34 columns in a printer file. This
indicator automatically set on whenever overflow occurs on a type of page.
35.How would you design the process for a nightly, high volume check producing process
that needs to select only records that are flagged to be processed?
With the help of OPNQRYF Clp command, we can select the records from the data base file. The
process involves following steps:
36.How would you join 3 separate fields, a first name, middle initial and last name together
as 1 field with proper spacing? You can describe in either RPG and/or RPG ILE
(Integrated Language Environment)
37. When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB
uses the RETRN operation to return to PGMA. When PGMA call PGMB the second
time is the *INZSR executed?
If you specify RETRN in called program, the *INZSR will not execute again.
38. Show 2 ways to convert a date from YYMMDD to MMDDYY (MULT operation not
acceptable)
PGM
DCL VAR(&VAR1) LENGTH(6) TYPE(*CHAR) VALUE('YYMMDD')
DCL VAR(&RCVD) LENGTH(6) TYPE(*CHAR)
DCL VAR(&VAR2) LENGTH(4) TYPE(*CHAR)
DCL VAR(&VAR3) LENGTH(2) TYPE(*CHAR)
CHGVAR VAR(&VAR2) VALUE(%SST(&VAR1 3 4))
CHGVAR VAR(&VAR3) VALUE(%SST(&VAR1 1 2))
CHGVAR VAR(&RCVD) VALUE(&VAR2 *CAT &VAR3)
SNDMSG MSG(&RCVD) TOUSR(*USRPRF)
ENDPGM
a. Cost = $110. 00
b. Tax = 20%
c. MarkUp= 05%
d. Sale = 10%
40. Define the purpose of Factor 1 the Operation Code and *IN15 in following code
HI LO EQ
C *YMD Test(D) yymmddDate 15
If the factor 1 value matches with factor2 value, the indicator specified in EQ comes *ON.
The SETLL operation positions a file at the next record with a key or relative record
number that is greater than or equal to key or relative record number specified in factor1.
The SETGT operation positions a file at the next record with a key or relative record number that
is greater than key or relative record number specified in factor 1.
Specifies whether the level identifiers of the record formats in the physical file are checked when
the file is opened by the program.
59. What is the difference between access path and Dynamic select?
Dynamic select occurs whenever the program reads file. But access path occurs before the file is
read (but not necessarily). Because access path maintenance performed on the file.
63. What is the difference between regular logical file and join logical file?
Regular logical file contains more than one record format.
Record format name in regular logical file should be same based on the physical file.
Join logical file contains only one record format.
Record format name in join logical file should be different.
Through logical file we can made changes in physical file.
Through join logical file we can't made changes in physical file.
66. What is the necessary keyword used in a physical file to refer field definitions from the
field reference file?
REF which is a file level keyword is necessary to define at file level in a physical file. The syntax
is as follows: REF(library name/name of the field reference file)
72. What are the different types of access paths maintained on the file?
Immediate: All the access paths (open and close) associated with a file will be updated whenever
changes made to a file.
Rebuild- only open access paths will update whenever changes made to the file. Rebuild takes
place whenever remaining access paths will be open.
Delay : Rebuild will not takes place.
74. What is the difference between production library and test library ?
In debug mode, the files exists in production library not allowed to update.
In the other hand, the files exists in test library allowed to update.
78. When will you use OPEN and CLOSE opcodes in RPG program?
If you specify the letter "U" at columns 73 - 74 in a file description specification indicating that
user control on a file. Hence we have to explicitly open and close the file in a program.
79. What is difference between fully procedural file and primary file?
In primary file the records will be read and processed from begining to end. This order is not
changed.
In fully procedural file the records will be read and processed in any order. The logic flow is
controlled by the opcodes in RPG program.
80. What is the difference between externally described file and program described file?
The field definitions and descriptions are defined out side of the program in a externally
described file. The field definitions and descriptions are defined in side the program in a
program described file.
It is always good CLP programming approach to check the object before you
rename, delete the objects on the system.
Display
Attribute Meaning
BL Blinking field
HI High Intensity
RI Reverse Image
CS Column separator
ND Non Display
PC Position cursor
UL Underline
89. What is the purpose of PUTOVR (Put with explicit override) keyword?
Use this record-level keyword to permit the override of either display file attributes or data
contents of specific fields within a record displayed on the work station device.
92. What is the maximum number of fields under a record format of physical file?
8000 (eight thousand)
103. What are the necessary keywords for the Join Logical file?
JDFTVAL, JFILE, JOIN, JFLD, JREF.
107. What is the use of UNIQUE keyword and what level it is defined?
It will avoid to enter duplicate key values. We have to define it in a file level.
108. At what level S,O are defined and what they will do?
109. What is the difference between Packed decimal and Zoned decimal?
Packed decimal : One digit occupies 1 byte.
Zoned decimal : One digit occupies 2 bytes.
110. What is default data type (if you define decimals '0') in Physical file?
Packed decimal
111. What is default data type for the fields(sub fields) defined in data structures in RPG?
Zoned decimal
117. What is the maximum number of key fields allowed defining in a physical file?
120
121. How many specifications are there in RPG/400? What are they?
There are seven specifications are exits in RPG/400. They are listed below:
* Header Specification
* File Description specification
* Extension specification
* Line counter specification
* Input specification
* Calculation specification
* Output specification
124. When do you explicitly open files and close files in an RPG program?
If you specify the letter ' U ' at column 73-74, you need to be open and close files explicitly in a
RPG program.
129. What are various techniques to pass parameters from one program to another?
PLIST, CALL, TFRCTL
130. Which single RPG opcode performs both SETLL and READE?
CHAIN
147. What are the two main attributes, which govern the execution of a job?
Run time priority and Time slice
162. What are the different ways to input data into data area?
CHGDTAARA (using CL)
Using OUT opcode in RPG
164. What are the valid user defined data area types?
CHAR, NUMERIC and LOGICAL
169. What are the two types of read performed on data queues?
Read with lock, and read without lock.
188. What are the different definition levels in Data Description Specifications?
File level, Record level, Field level, Join level, Keyfield level, Select/Omit level.
189. What the difference between Source Physical File and Physical File?
A Source Physical File contains the source for the various objects created this file has specific
structure.
A Physical File contains data, and the record format can be different for different physical files.
192. What is the default value for the number of increment for the physical file?
Three
200. What is the maximum number of records you can specify in a display file?
1024
201. How can a screen field that has changed since the last output operation be detected ?
Attach the MDT (modified data tag) attribute to the field, to detect whether field has been
changed as a result of user input.
202. What would be the effect on the field where reverse image, underline and highlight
display attributes were active?
The result is same as if you had specified ND.
204. If DSPATR(PC) and CSRLOC were specified for a format, which keyword would have
priority?
CSRLOC gains priority.
205. Can error messages as a result of a COMP, RANGE or VALUES keyword be overridden?
Yes, through CHKMSGID keyword.
207. How can a message from a message file appear as a constant on the screen?
By using MSGCON (message constant) keyword.
208. In conjunction with what other keyword must OVRDTA and OVRATA be used?
PUTOVR keyword must used.
218. What is the maximum number of subfiles that can be specified in a display file,
512
219. Maximum number of subfiles that can Defined in a RPG program for one display file is
24
220. Maximum number of subfiles that can be active for a single file is?
12
221. Can more than one subfile record be displayed on one line?
Yes, by using SFLLIN keyword.
224. How to pick up the changed records every time in a subfile after the first change
made?
Seton SFLNXTCHG keyword indicator and update the subfile record.
226. How to toggle between single line and Multi - line display of a particular record in a
subfile?
Using SFLDROP keyword.
244. How do you specify page overflow indicator for printer files in RPG?
Specify an indicator in position 33-34 of F specification.
249. Can you specify a display file to be used in the following modes Input, Output, or
Combined modes ?
Yes.
253. What opcode could be used to test an alphanumeric field for all numeric values?
TESTN
267. How can the user implicitly open and close the files in RPG program ?
Enter UC in position 71-72 of F specs.
Use OPEN and CLOSE opcodes in RPG program to open and close files.
271. What is the maximum number of times Multiple Occurrences DS can occur in a
program?
9999
******************************************************************************
285. How many record formats can you have in a Physical file and in a Logical file ?
Physical file can contain only one record format, Logical file can contain more than one record
format.
350. How will you add a field to physical file already containing data?
With CPYF command and *NOCHK & *DROP
351. What are the uses of FACTOR1, FACTOR2 and RESULT field for the RPG operation code
PARM?
It is add value of FACTOR1 to FACTOR2 or compare the value of FACTOR 2 with FACTOR1.
364. How you will find an error which is not in the first page of the subfile without using
ROLLDOWN key?
By using keyword SFLRCDNBR.
366. How you will know whether you are in SFLDROP or SFLFOLD mode?
Bu using the keyword SFLMODE.
367. How you get the relative record in a subfile in which cursor is located?
By using the keyword SFLCUSRRN (Subfile cursor relative record number).
372. How to translate field values form lower case to Upper case?
By using opcode XLATE.
373. What are the maximum parameters can be passed from one RPG program to another
RPG program?
255
374. How many maximum parameters can be passed from on RPG program to another CL
program?
40
375. How many maximum arrays can be used in a single RPG program?
200.
376. How many maximum loops can be used in a single RPG program?
100
377. How many maximum printer files can be used in a single RPG program?
8
381. How do you write and read a value (similarly as EXFMT of RPG) using a display file in
CL?
SNDRCVF.
395. If your workstation does not show login screen what might be the problem?
Problem with some subsystem.
396. You have given a job for printing and you are not getting the printout what might be
the reason?
397. There are multiple jobs for printing in job queue and you want to print a important
document then what will you do?
Change the priority or change the job queue name.
399. Which Function key should be pressed to define hidden field while you are working
with SDA?
F4
400. Which function key should be pressed to watch all strings defined on the SDA screen?
F20
401. While designing the screen using SDA, which function key should be pressed to get
the field from the field reference file?
F10
402. From work with member using PDM screen you have to modify existing member using
SDA, which option do you select?
17
403. Write system defined function used to place system name on the screen
*SYSNAME
404. While designing the screen, F3 function key is kept common for all record formats.
On which level should it be defined?
File Level
405. Write down any two mandatory keywords used when defining a subfile?
SFLDSP, SFLDSPCTL, SFLCTL, SFLSIZ, SFLPAG.
406. While designing the screen user wants to add file level keywords, then which function
key should be pressed?
F14.
408. While designing the report using RLU, user wants to add record level keyword then
which function key should be pressed?
F18.
409. If user wants to add one field on the report then which function key should be
pressed?
F11.
410. SDA: After getting field reference from reference file selected files will appear at the
bottom of the screen and then which command function will be used to get it on
screen with its label to be left aligned?
&3L
412. If user wants to change the length of the numeric field defined in report then which
combination of keys will be used?
F23 & F10.
414. RLU: If user wants to define new numeric field on record format then which line
command will be used?
VF.
415. Maximum report length is 132, if user is designing a report using RLU?
FALSE (378 Max).
416. To change constant field defined on RLU screen which field level keyword should be
used?
DFT
417. RLU: Which field level keyword should be used to change any numeric field of length 8
to 99.99.9999 format?
EDTWRD (‘ . . ‘)
418. SPACE and SKIP are FIELD & RECORD LEVEL keywords.
420. Using Query, its also possible to create level break reports.
TRUE.
421. Using DFU, user will be able to ___________ from Physical File?
Add/Update/Selected or all fields.
422. What is the difference between normal UPDDTA to PF and updating using DFU
program?
Both are same only difference is DFU allows you to add or change selected fields.
437. What is the command to know how many LF are related to a PF?
DSPDBR (Display Database Relationship)
441. What is the object type of PF, LF, Printer file & Display file?
*File
442. How many types of display are available on As/400 for user interaction?
4 Types they are Entry, Menu, Information & List Display.
449. How many Specs are there in RPG & Which are they?
There are 7 Specs in RPG they are H, F, E, L, I, C & O.
455. How many printer files maximum can be used in single RPG program?
8 because of the overflow indicators OA-OG & OV.
456. When you are defining a flat file in your program in F Specs which format will you
specify?
Flat File: - F (Fixed Length)
Other File: - E (Externally Described)
482. Which is the subsystem that is always on till the main power switch is off?
QCTL
485. Which are the libraries (system) always present in the library list?
QTEMP & QGPL
496. What is the opcode to release all the locks on a particular PF?
UNLCK
499. How can we know the triggers associated with the PF?
DSPFD with parameter TYPE (*TRG)
501. F is the type of file desg. Used for externally described files given when file types are?
I&U
511. If the data is likely to change over a period of time & Moreover data is large than
which type of table is preferred?
Compile Time Table.
514. The Qualified name for an object ORDPF residing in a library TRAINING is?
TRAINING/ORDPF
521. The function key to start SEU session through program development manager is?
F6
522. The Member type for an RPG & CL program which SEU supports is?
RPG & CLP
523. Printed output items placed in an output queue are known as?
Spool Files.
526. Change in the externally described file does not require recompilation of the
program? (True/False)
False
529. Which one of the following has the highest priority Library on top of the library list,
Library QGPL, Library on the bottom of the library list & Current library?
Current library
531. While designing the screen user wants to add file level keywords then which function
key is pressed?
F14
532. While designing the report using RLU user wants to add record level keywords which
function key is pressed?
F18
533. If user wants to add one field on the report then which function key is pressed?
F11
534. If user wants to center the company name on his report then which command will be
used?
CF (Center Field)
539. What is the difference between UPDDTA to PF & updating using DFU?
Both are same, only difference is DFU program allows you to add & update selected fields.
540. Which function key should be pressed to define hidden field while you are working
with SDA?
F4
541. Which function key should be pressed to watch all string defined on SDA screen?
F20
542. While designing the screen using SDA, which function key should be pressed to get
the field from the FRF?
F10.
543. From WRKMBRPDM screen you have to modify existing member-using SDA which
option do you select?
17.
544. Write system defined function used to place system name on the screen?
*SYSNAME
545. While designing screen F3 function key is kept common for all record formats on
which level should it be defined?
File level
546. Write down mandatory keywords used when defining a subfile?
SFL, SFLDSP, SFLSIZ, SFLCTL & SFLPAG
547. If user wants to change the length of the numeric field defined in the report then
which combination of the keys will be used?
F23 & F10
548. What is the difference between SKIPB (2) & SPACEB (2)?
SKIPB (2) skips 1 page & on the next page after skipping 2 lines space print next while SPACEB
(2) skips 2 lines space before printing.
549. RLU: If user wants to define new numeric field on record format then which line
command will be used?
VF
550. Maximum report length is 132, if user is designing a report using RLU?
FALSE (Maximum is 378)
551. To change constant field defined on RLU screen which field level keyword should be
used?
571. Which are the four keywords supported by Program Status Data Structure?
*STATUS, *PARM, *ROUTINE & *PROGRAM
580. Join Logical File displays data from how many files?
2 or more PF’s
582. Which are the Query selection criteria, which can be given in a Query?
LIST
583. To add a file to the ‘File Selection’ option of a Query, the function key to be pressed
is?
F9
591. What is the values SQLCOD when there is an error in fetching the records specified in
the select statement?
-ve value
595. Which are the DB2 tools to protect Integrity of the database?
Journaling & Commitment Control, Referential Integrity Embedded SQL & Object/Record Locks.
597. Which of the CL command can be used to determine which logical files are dependent
on a specific file?
DSPDBR
598. Which CL command is used to trap error messages during program execution?
MONMSG
599. Which CL command can be used at program execution to redirect the file named in an
RPG program?
OVRDBF
600. What is the length of the variable in the given example? DCL VAR (&Name) TYPE
(*Char)?
Default 32 & for Decimal 15,5
601. Which of the following CL command us used to display a screen & wait for the user to
press enter or a function key?
SNDRCVF
602. A CL program, EMPCL1 calls the RPG program EMP001 & the calls the RPG program
EMP002.RPg program EMP001 & EMP002 were both written to process the file, In order to test
changes in EMP001 a test file called TESTEMP is library TESTLIB needs to be used EMP002
should process EMPMAST as it normally would.
Add the following CL statement directly before the call to EMP002 DLTOVR FILE (EMPMAST)
608. Submitting a job using numeric parameters, the length of the parameter should be?
15,5
617. Which of the following options describes the result of using the USROPN keyword?
This file must be opened with an explicit OPEN operation prior to accessing this file.
620. Which of the following methods will make externally describe file fields available to a
program?
A Data Structure definition specification that names the file on the EXTNAME keyword.
622. What ILE RPG/400 code procedures the same results as the RPG/400 code shown
below?
C A Add B Sum1
Sum1 Mult X Rslt
Rslt Div Tot Answ
C Eval Answ = (A+B)*X/Tot
623. The DATFMT keyword allows you to specify which of the following date format?
*USA
624. What is the command invoked when we give option 14 to RPGLE program?
CRTBNDRPG
625. What will happen, if we use STRISDB command for RPGLE program?
Error: Program type not valid
626. If we want to define a new variable $Aprid with same attributes as field Crpid, the
RPGLE code look like this:
D $Aprid S Like (Crprid)
627. The keyword used to define number of entries per record for Tables/Arrays in RPGLE
is?
PerRcd (n)
628. What will be the output of the following ILE code?
D Loandate SD DATFMT (*USA) Inz (D’12 31 92’)
UBDUR -30: *D Loandate
631. Which is the Built in function to convert numeric field to Alpha field?
%EDITC, %EDITW, %CHAR
632. If user wants to retrieve the time in microseconds, what Would be data type of the
field?
Z
637. For CHAIN, SETLL, SETGT, READE, READPE & READE where indicators are given &
their success?
Opcode Success Indicator
CHAIN OFF HI
READ, READE, READP, READPE OFF EQ
SETLL ON EQ
SETGT ON HI
Single Page/non-elastic – In this case sub file size (SFLSIZ) must be equal to sub file page
(SFLPAG). For example, if SFLSIZ = 10 and SFLPAG = 10, then 10 records from file are written
to subfile. In this case PAG
656. In case of Load all sub-file, if we type options and then PGDN,PGUP , will options be
there on the display / in subfile.
Yes. It will retain all the options entered in the previous page.
657. How will you take care of multiple options in case sub-file?
We will have to handle it within the program using a READC in a loop.
658. If we type some options on screen out of which some are invalid and pressed enter,
what should happen?
It should process all the valid options before invalid options encounter. Once invalid options is
encountered program should stop processing and display error message at the bottom of the
scrreen.
677. If we tried to move year part of *ISO date into a field of length 3, what will happen ?
Program crashes, as in case of *ISO format it required fields of 4,2,2.
680. OVERLAY
It allows a record format to be displayed on screen retaining the previous displayed record
formats.
688. What is the stored procedure and how do you define a stored procedure.
A stored procedure is a program that can be called to perform operations that can include both
host language statements and SQL statements. Procedures in SQL provide the same benefits as
procedures in a hot language. That is, a common piece of code need only be written and
maintained once and can be called from several programs. Stored procedures can be used in
both distributed and non-distributed applicaitons.
We can have parameters as IN , OUT , INOUT type. Language can be RPGLE, C, CL, etc..
MYLIB/PROC1 this PROC1 is a program written and compiled separately and it is of language
which you are specifying in section LANGUAGE.
689. Writing an SQL statement from selecting records from TWO files using single
statement and Nested select statement.
Using Single statement.
SELECT * FROM FILE1, FILE2
WHERE FILE1.FLD1 = FILE2.FLD1
Type of constraints
*REFCST - A referential constraint is being added
*UNQCST - A unique constraint is being added.
*PRIKEY - A primary key constraint is being added
*CHKCST - A check constraint is being added
*CASCADE –
The cascade delete rule is used. Deleting a record in a parent file causes matching
records in the dependent file to be deleted when data for a non-null parent key matches data for
a foreign key.
*RESTRICT –
Updating a record in a parent file is permitted if data for a non-null parent key does not match
data for a foreign key.
Updating a record in a parent file is restricted if data for a non-null parent key matches data for
a foreign key.
693. Can we have records (with fields from more than one file) from multiple files and
Nested / sub query in SQL ?
Yes, we can have record from multiple file with join condition and we also can have nested
query or subquery like SELECT * FROM FILE1 WHERE FILE1.FLD1 IN (SELECT FILE2.FLD1
FROM FILE2)
697. What are the two important parameter while creating a SQLRPGLE program ?
1) CMTCTL - *NONE (Commitment Control)
CLOSQLCR - *ENDMOD (End of Module) by default is *ENDACTGRP
698. Can we update database file with the help SQL Cursor ?
While declaring the cursor if we specify FOR READ then we cannot update but if we specify FOR
UPDATE or nothing (by default is FOR UPDATE) then we can update database file.
700. What will happen if we call stored procedure again and again ?
It the creation of procedure is included in the called program, then we can have different set of
output depending upon the parameter passed to it. And If creation is outside the called program
then we will be available with only one set of output.
Miscellaneous
710. Which program RPG or CL is efficient to update a transaction onto a database file and
why ?
CL program cannot update/write onto a data base file and hence, choice is RPG program.
713. What kind of job is it --- you have signed on AS400 and then typed Call XYZ and pgm
XYZ is an RPG program which simply reads a database file and generates report.
It is not a job.
719. How many record formats can you have in a Physical & Logical file?
Physical file can contain only one record format where as Logical file can have more than one
record format.
720. Which is the better option to write a transaction (order header and detail transaction)
using two physical files or one join logical file(on those two physical files) in a
program and why ?
Using two physical files is the better option because records can't be written through join logical
file.
723. What is difference between Multi record format Join and Non- Join logical file ?
Multi record format logical file contain more than one record format( based on one or more
physical file) With join logical file only read operation can be done whereas in non-join logical file
all operations can be done.
726. Can a file be used under commitment control without being jorunaled ?
No
729. What are different types of Arrays and what is the difference between them ?
There are 3 types of arrays Compile time, Pre-Run time and Run time. Compile time array gets
value at the time of compilation of the source of a program. Pre-run time array gets value from a
file at the beginning of a program execution (before any statement of a program is executed).
Run time array gets value during the program execution.
732. Can an indexed file (File with key fields) be accessed in arrival sequence in an RPG
program ?
Yes, don't specify "K" in F specification in the program for this file.
733. What is the difference between *LIKE and *NAMVAR opcode?
*LIKE defines program variable same as that of another pre defined variable. *NAMVAR is used
to define variable as Data area.
736. How will you display a particular page (or record) in a Sub file?
Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in
DDS
737. What is difference between Command Function and Command Attention key?
Command function key returns variable value along with response indicator (associated with CF
key) where as Command attention returns only the response indicator value.
What's the difference between CHAIN and SETLL? Is there a performance advantage?
There are two important differences between CHAIN and SETLL.
1. The CHAIN operation applies a record lock to files that are open or update. The SETLL operation
does not apply the lock.
2. The CHAIN operation copies the record's data to the input buffer for the program. The SETLL
operation does not.
Syntax: All non-external data definitions can now be specified in a D-specifications that are new to ILE
RPG. In addition you can define "named constants" that greatly simplify coding in the C-spec's. Also C-
spec formats have changed slightly to provide for variable names of up to 10 characters (up from 6 in
RPG/400) and longer operation codes.
New Operations: Several have been added. One that I like is EVAL which allows you to evaluate a
mathematical expression similar to Cobol and other mathematical programming languages such as
Basic, FORTRAN, PL/1, etc.
Modularity: This is a big plus. You can now write modules (non-executable) in several languages and
bind them together into a single ILE program. Thus you can use the best language (ILE C, ILE Cobol, ILE
RPG, ILE CLP) for a process or use existing modules to write a program. You can also write callable
procedures or procedures that function like built-in functions.
More: There is of course much more that is new in ILE RPG. For performance reasons, you should have a
good understanding of ILE. Bryan Meyers has written several very good articles in NEWS/400 that can
help you avoid some ILE traps. He is also one of the moderators
You can prompt SBMJOBS just like you would SBMJOB. When the above command is
executed, the following will be displayed.
Report: Submit Job www.5-10.com 8/12/00 08:43:30
Outq.................. STEVE
Copies................ 1
Hold Y/N.............. N (Hold and not print until released)
Save Y/N.............. N (Save after printing)
Print Text............ *NONE
Out Schedule Priority. 5 (1-9)
Job:
Hold on Job Queue y/N. N (Run at night)
Schedule Date......... *CURRENT (*current, *mon...) F4=Calendar
Schedule Time......... *CURRENT (1300 is 1:00pm, *current)
Job Date.............. *SCHEDULE (No slashes, *schedule) F4=Calendar
Job Priority.......... 5 (1-9)
Jobq.................. *JOBD
For user.............. *CURRENT (*current)
Current Library....... *CURRENT
Job Description....... *USRPRF
Job Name.............. TEST
CPI...................
F1=Help F3=Cancel,
OUTQ Output queue to put your report. Available outq's are
COPIES Number of copies all reports will print
1 - 99 are valid entries
HOLD Hold report Y/N
Y - Hold the report on the out queue
N - Print the report
SAVE Save Y/N
Y = Save the report after printing.
N = delete the report from the out queue after printing
OUTPTY Report outq schedule priority
1 - 9, 1 will schedule before 9
JOBHLD Run at night
N = Submits to normal jobq.
Y = Submits to NITES jobq.
This allows users to run jobs after the nightly billing has finished. The NITES queue will
be on hold during the day. It is released by your billing job. Then it is reholds after all
jobs in the NITES queue is complete. You will need to create the NITES Queue, and put
the following commands at the end of your nightly billing job.
RLSJOBQ JOBQ(NITES)
SBMJOB CMD(HLDJOBQ JOBQ(NITES)) JOB(HLDJOBQ) JOBQ(NITES) JOBPTY(9)
SCHMDY Schedule Date
Use this field to specify when a job is to run. Example, you want to run something on
Sunday when the system is not busy.
*Current - eligible to run on today
010194 - eligible to run on 01/01/94
*mon *tue *wed *thu *fri *sat *sun -
Becomes eligible to run next Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
or Sunday.
F4 will not work unless you have down loaded the calendar program. Use it to Popup a
calendar and select the date you wish the job to run on.
Saturday August 12, 2000
Sun Mon Tue Wed Thr Fri Sat
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Select 8/12/2000
F1=Help F3=Exit Rollup/down
Examples
PCVTSAVPF FROMFILE(TFRLIB/TFRSAV1)
TOFILE(TFRLIB/TFRPF1) MBR(*FIRST)
Command above converts the contents of the save file TFRSAV1 in
library TFRLIB to a physical file TFRPF1 in the same library.
Restrictions
1) The physical file must have a record length of exactly 528 bytes if the corresponding
PCVTPFSAV command is to process correctly. In other words, use the CRTPF
command with a RCDLEN(528) parameter to create the TOFILE physical file for the
PCVTSAVPF command.