As400 Int Questions
As400 Int Questions
As400 Int Questions
OfileA...E...Change
O...............field2
Answer to 3)
Method 1:
ENDMON
Method 2:
Activate the Error Indicator, for the field you want to
place the error handling
if any error occurs for that field %error is SETON, and u
can use this indicator to take action accordingly
D New_File E DS EXTNAME(Old_File)
D New_Field1 E EXTFLD(Old_Fld1)
D New_Field2 E EXTFLD(Old_Fld2)
1)STRDBG PGMA
2)In debugging view press F14 and select option 1 ,specify
pgm name ,library.
3)Press enter ,select module source from list, add break
point in PGMB
4)Press F14, add brk point sin PGMA.
5)Call PGMA
It will start the debugging for 2 programs
Q. What is scan and check ? give me real time scenarios where
we used these keywords in your projects?
A. FACTOR 1 OPERATION FACTOR 2 RESULT
Comparator SCAN Base left most
String: Length String: length position
of string
Q. How can we read a particular record from the database file which is
not having DDS (Flat File). For example, there are 100 records in the
flat file. How can we retrieve 15th record in RPG/400 program (Without
using CL.
A. We need to use the following.
Factor 1 = 15
Opcode = CHAIN
Factor 2 = File Name
when we copy the data from one file to another file that
time if user want to create new file then create new file
object by using CPYF command. We can add/replace the add by CPYF
command while by CRTDUPOBJ command can’t.
We can copy specific records with the help of CPYF command but we can’t
do with CRTDUPOBJ.
Q. what is mean by *MAP and *DROP? what commands use these two
keywords? why are they used?
A. Why *MAP and * DROP?
When we copy data from FILE A to FILE B and if FILE A has
20 fields and FILE B has 30 fields (say there are 10 fields
which is not common among both the files). Using *MAP and
*DROP option we can copy the data from FILE A to FILE B.
All the fields would be mapped between both the files and
the unmatched fields would be dropped.
Which command uses *MAP & *DROP - CPYF command (Copy file).
Q. how to display all the members records in a physical file
without using ovrdbf?
A. The question mean to display the records in particular
members of Physical file ...this can be achieved by
EXTMBR(member name) along with the file in f specs
D New_File E DS EXTNAME(Old_File)
D New_Field1 E EXTFLD(Old_Fld1)
D New_Field2 E EXTFLD(Old_Fld2)
Strdbg SRVPGM(ABC)
add brak point
now call the Wrapper program.
------or -----------------------
Strdbg Wrapper program name
than F14 to work with module list
and add your service program(*SRVPGM) and add the break.
Call wrapper.
1) pgm1 calls pgm2 , pgm2 calls pgm3, pgm3 calls pgm4, pgm5 calls
pgm6 . you are in pgm6. How you will find main progam ???
A. Use LDA to store main program name
2) some source is deleted. Object is there ? how you will retrieve the
source ?
A. object should be present in the spool file and we can copy restore
source from spool file.
3) without doing SETLL, read , chain how you can find that there are
records in file?
A.Use OVRDBF command with QCMDEXC and return the number of records in
the file.
4) there is one file PF in lib1, same PF file in lib2 , you have to
access those same files lying in different libraries in RPG pgm . How
you will do that ?
Hi,
Without doing I/O operations how you will find the number of records in RPG
program( Cl command should not be used)
In INFDS , There is subfield starting from 156 to 159 thru which you can get count of
records in file against which INFDS is specified.
But another trick is also that you have to populate this subfield thru POST opcode
otherwise you can’t get it. Below are codes that I used for finding the answer.
F INFDS(NUMRCDS)
DNUMRCDS ds
/Free
MONITOR;
Open emp1;
ON-ERROR 1217;
Dsply ' File not found'
return;
ENDMON;
/END-FREE
DOW '1'
//whatever
ENDDO
This process is different from the static binding process used to bind modules into
programs. However, you can still call the service program's exported procedures
as if they were statically bound. The initial activation is longer, but subsequent
calls to any of the service program's exported procedures are faster than program
calls.
That is, to execute any program from command line or call it from
another
program, your program should have PEP.
Q: What is a signature?
A: A signature is a value that provides a similar check for service programs that a level check
does for files. It helps ensure that changes made to the service program are done in such a way
that the programs using them can still function properly. The signature is typically generated by
the system when you issue a Create Service Program (CRTSRVPGM) command specifying
Export(*ALL). The signature value is generated by an algorithm that uses as input the names of
all of the service programs "exports" and their sequence. "Exports" are the names of callable
procedures and any exported data items. When you create a program that references that service
program, its current signature value is copied into your program. If the export list were to be
changed without the programs detection, the program could potentially call the wrong procedure.
A: When a program is called, it immediately checks the signature value of any service programs
that it uses and produces a signature violation message if the signatures don't match. This
happens at program start up not when you actually call a service program procedure.
4) In binding directory u can add any source member that has no object?
A binding directory contains the names of modules and service programs
that you may need when creating an ILE program or service program.
Modules or service programs listed in a binding directory are used only
if they provide an export that can satisfy any currently unresolved
import requests. A binding directory is a system object that is
identified to the system by the symbol *BNDDIR.
Note:
The more modules or service programs a binding directory
contains, the longer it may take to bind the programs. Therefore,
you should include only the necessary modules or service programs
in your binding directory.
Because binding directory entries are just names, the objects listed
do not have to exist yet on the system.
2)In ALDON CMS how u check out(option?) and what options are for
finding dependable objects?
41 option is to search the pr
3)there is one physical file containing huge data in production. how u
will add one field in that file?
First change the Fields thru the DDS of the file
CHGPF FILE(yourlib/yourfile) SRCFILE(yoursrclib/yoursrcfile)
SRCMBR(*FILE)
A: Use the Update Program (UPDPGM) command. Because you aren't replacing any modules,
specify Module(*None). You don't need to specify the service program because the UPDPGM
command automatically re-checks the signatures of any bound service programs. If any
signatures have changed, it also updates the programs signature values.
A: That can be difficult. If you have a cross-reference tool that understands service programs, it
should provide the information you need. Otherwise, you can display each program using the
Display Program (DSPPGM) command and see (on the fourth display screen) the list of service
programs it uses and what signature value it's looking for. Of course, if you know the signature
has changed, the fact that the program references the service program tells you it must be
updated. This method is tedious to do manually. You could also write a program to automatically
perform the updates for you using the appropriate APIs (DSPPGM has no outfile support). This is
beyond the scope of this article but we may cover it in the future.
Q. Do you have any idea about Argument fetch error? when it happens?
A.