rakesh


{ City } bangalore
< Country > india
* Profession * ita
User No # 102714
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 5
Users Marked my Answers as Wrong # 0
Questions / { rakesh }
Questions Answers Category Views Company eMail




Answers / { rakesh }

Question { IBM, 5202 }

HI,
1: WHAT IS THE FUNCTION OF %KDS?WITH PROGRAMMING CODES
EXAMPLE
2: WHAT IS THE FUNCTION OF Z-ADD AND Z-SUB ? WITH
PROGRAMMING CODES EXAMPLE


Answer

1:
%KDS is allowed as the search argument for any keyed
Input/Output operation (CHAIN, DELETE, READE, READPE, SETGT,
SETLL) coded in a free-form group. The search argument is
specified by the subfields of the data structure name coded
as the first argument of the built-in function. The key data
structure may be (but is not limited to), an externally
described data structure with keyword EXTNAME(...:*KEY) or
LIKEREC(...:*KEY)..
Notes:

The first argument must be the name of a data structure.
This includes any subfield defined with keyword LIKEDS or
LIKEREC.
The second argument specifies how many of the subfields
to use as the search argument.
The individual key values in the compound key are taken
from the top level subfields of the data structure.
Subfields defined with LIKEDS are considered character data.
Subfields used to form the compound key must not be arrays.
The types of all subfields (up to the number specified
by "num-keys") must match the types of the actual keys.
Where lengths and formats differ, the value is converted to
the proper length and format.
If the data structure is defined as an array data
structure (using keyword DIM), an index must be supplied for
the data structure.
Opcode extenders H, M, or R specified on the keyed
Input/Output operations code affect the moving of the search
argument to the corresponding position in the key build area.

Example:
Figure 205. Example of Search on Keyed Input/Output Operations

A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
A R CUSTR
A NAME 100A
A ZIP 10A
A ADDR 100A
A K NAME
A K ZIP
FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++++++++++++++++
Fcustfile if e k disk rename(CUSTR:custRec)
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++
D custRecKeys ds likerec(custRec : *key)
...
/free
// custRecKeys is a qualified data structure
custRecKeys.name = customer;
custRecKeys.zip = zipcode;
// the *KEY data structure is used as the search
argument for CHAIN
chain %kds(custRecKeys) custRec;
/end-free

Googled/ref :-
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.langref.doc/c0925086640.htm


2: Z-ADD and Z-SUB does the ADD/SUB resp. to a field of Zero.

Z-ADD 5 VAR
** (VAR now has 5)
ADD 10 VAR
** (Var now has 15)
Z-ADD 20 VAR
** (Var now has 20 and not 35)

*...1....+....2....+....3....+....4....+....5....+....6....+....7...
CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++*
C* Before the operations are processed, the field values are:
C* A = 1.00 G = 2.77
C* B = 10.0 H = 70
C* C = 32 J = .6
C* D = -20 K = 25
C* E = 6. L = 1.0, 1.7, -1.1 RESULTS
C* F = 10.0 -------
C ADD 1 A 30 002
C B ADD C V 52 042.00
C B ADD D V -10.00
C*
C Z-ADDC V 032.00
C*
C SUB 1 E 30 005
C C SUB B W 51 0022.0
C C SUB D W 0052.0
C*
C Z-SUBC W -0032.0
C*
C MULT E F 30 060
C B MULT G X 84
0027.7000
C B MULT D X
-200.0000
C*
C DIV B H 30 007
C C DIV J Y 62 0053.33
C*
C MVR Z 53 00.020
C*
C SQRT K Z 05.000
C*
C XFOOTL Z 01.600

Ref:-
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r5/index.jsp?topic=/com.ibm.etools.iseries.langref.doc/evferlsh239.htm

Is This Answer Correct ?    1 Yes 0 No

Question { 8111 }

Is it possible to call a subfile using CL. IF yes.. kindly
help me out with explanation...?


Answer

In CL procedures and programs, message subfiles are the only
type of subfiles supported. To use subfile message support,
run a SNDF or SNDRCVF command using the subfile message
control record. In the DDS, supply SFLPGMQ data and always
have SFLINZ active.

When you use message subfiles in CL procedures and programs,
you must name a procedure or program. You cannot specify an
* for the SFLPGMQ keyword in DDS. When you specify a
procedure or OPM program name, all messages sent to that
procedure's or program's message queue are taken from the
invocation message queue and placed in the message subfile.
All messages associated with the current request are taken
from the CALL message queue and placed in the message subfile.

Message subfiles let a controlling procedure or program
display one or more error messages.

Ref:-
http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/evfclmst161.htm

Is This Answer Correct ?    4 Yes 0 No