|
View previous topic :: View next topic
|
| Author |
Message |
mjadwani2785
New User
Joined: 28 Apr 2009 Posts: 89 Location: Noida , Dublin
|
|
|
|
Hi ,
Can DSNALI , CAF interface module be invoked using rexx call command ?
Is there any manual I can refer , or sample syntax for calling ?
Regards,
MJ |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
why would You want to do that ?
DB2 already provides a REXX interface ! |
|
| Back to top |
|
 |
mjadwani2785
New User
Joined: 28 Apr 2009 Posts: 89 Location: Noida , Dublin
|
|
|
|
Hi Enrico ,
I am just curious . I want to experiment with status condition it returns as manual says reg terminate ecb , start ecb and release identifier block .
Inturn I will get better understanding of CAF by implementing it practically .
I know about DSNREXX .
Regards,
Manoj K Jadwani |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
even if it could be possible to build the DSNALI parameter list
( see IGGCSI00 for example )
how do You plan to handle the DBRM things ???
I might have somewhere a RXSQL interface I wrote a LOONG time ago.
if I can find it I will post it |
|
| Back to top |
|
 |
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
| If you want to experiment with CAF, it would be easier to use COBOL. |
|
| Back to top |
|
 |
mjadwani2785
New User
Joined: 28 Apr 2009 Posts: 89 Location: Noida , Dublin
|
|
|
|
I was able to successfully write this . Invoke was successfull. I can trace through RIB control block .
Here is the crude code , still working on it .
[img]
/*rexx */
ssid = 'DTE0'
command = 'CONNECT '
ter=' '
stae=' '
rib=' '
ADDRESS LINKPGM "DSNALI COMMAND SSID TER STAE RIB"
say rc
say ter
say stae
say rib
hexrib =c2x(rib)
rib_inf= storage(hexrib,62)
say rib_inf
[/img]
Just have a question regarding control block what does signed and unsigned datatype represent ?
For Eg RIBCNUMB is unsigned datatype . How to interpret this info.
OFFSET OFFSET
DECIMAL HEX TYPE LENGTH NAME (DIM)
======== ======== ================== ==============
0 (0) STRUCTURE 62 RIB
0 (0) UNSIGNED 2 RIBCODE
2 (2) SIGNED 2 RIBTLEN
4 (4) CHARACTER 4 RIBEYEC
8 (8) CHARACTER 9 RIBCID
8 (8) CHARACTER 4 RIBECODE
12 (C) CHARACTER 3 RIBPCODE
15 (F) CHARACTER 2 RIBFCODE
17 (11) CHARACTER 3 RIBREL
20 (14) ADDRESS 4 RIBCPTR
24 (18) UNSIGNED 1 RIBCNUMB
25 (19) UNSIGNED 3 *
28 (1C) SIGNED 4 RIBCLID
32 (20) SIGNED 4 RIBSPEL
36 (24) CHARACTER 4 RIBCATVS
56 (38) CHARACTER 4 RIBRELX
56 (38) CHARACTER 3 RIBREL3
56 (38) CHARACTER 2 RIBRELV
58 (3A) CHARACTER 1 RIBRELR
59 (3B) CHARACTER 1 RIBRELM
60 (3C) CHARACTER 2 *
62 (3E) CHARACTER 0 RIBCINFO
62 (3E) CHARACTER 0 *
62 (3E) CHARACTER 0 RIBEND
Manual says
"You can determine what release level of DB2 you are
currently running by examining the RIBREL field. If RIBREL is '999', the actual
version, release, and modification level of DB2 is indicated in the RIBRELX
field and its subfields.You can determine the modification level within the
release level by examining the RIBCNUMB and RIBCINFO fields. If the value
in the RIBCNUMB field is greater than zero, check the RIBCINFO field for
modification levels. "
How to examine RIBCNUMB field when its type is unsigned .
Regards,
MJ |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
the variables used should be initialized to something with the same length of the expected returned parameter
this time You were lucky, probably next time You will face quid a bit of unexpected happenings |
|
| Back to top |
|
 |
mjadwani2785
New User
Joined: 28 Apr 2009 Posts: 89 Location: Noida , Dublin
|
|
|
|
Thanks Enrico ,
Actually I initialised them with same length , "CONNECT+5 blanks" = 12 bytes of data as manual says for the function parameter was passed similarly for other variables . While copy pasting blanks were auto missed .
If you can help me with signed and unsigned fields of control block what do they represent and how can interpret those from the RIB control block description given above ?
Regards,
MJ |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
good manners suggest to use for source snippets the code tags
they force the use of fixed pitch fonts and preserve the spacing
without
12345678901234567890
" "
with
| Code: |
12345678901234567890
" "
|
frankly You are wasting Your employer time
ok You were able to issue a connect ... ( pretty basic )
when attempting the OPEN ...
please tell the PLAN NAME YOU are going to use
and ...
the usual sequence is
PREPARE
short DESCRIBE to find out the statement type
after that
EXECUTE
or
long DESCRIBE to find out about statement details
( column lengths and friends )
DECLARE the cursor
OPEN the cursor
FETCH the cursor ...
CLOSE the cursor
and naturally the declaration for SQLCA and SQLDA
here is the expansion for a simple prepare
| Code: |
319 * EXEC SQL PREPARE S1 FROM :STMT
320 B *+56
321 DC H'64',X'4000',H'35'
322 DC XL8'525853514C202020'
323 DC XL8'19A2508413B19280',H'1'
324 DC H'1208,14,0',X'0080',H'0',9H'0'
325 MVC SQLPLLEN(24),*-52
326 MVC SQLSTNM7(28),*-34
327 LA 15,SQLCA
328 ST 15,SQLCODEP
329 LA 14,SQLPVARS+16
330 SLR 15,15
331 ST 15,4(,14)
332 MVC 0(2,14),=H'452'
333 MVC 2(2,14),=H'0'
334 ST 15,8(,14)
335 ST 15,12(,14)
336 LA 14,44(,14)
337 LA 15,STMT
338 ST 15,4(,14)
339 MVC 0(2,14),=X'01C0'
340 MVC 2(2,14),=H'256'
341 SLR 15,15
342 ST 15,8(,14)
343 SLR 15,15
344 ST 15,12(,14)
345 LA 14,SQLPVARS
346 MVC 0(8,14),=XL8'E2D8D3C4C1404008'
347 MVC 8(4,14),=F'104'
348 MVC 12(2,14),=H'2'
349 MVC 14(2,14),=H'2'
350 ST 14,SQLVPARM
351 MVC SQLAPARM,=XL4'00000000'
352 LA 1,SQLPLLEN
353 ST 1,SQLPLIST
354 OI SQLPLIST,X'80'
355 LA 1,SQLPLIST
356 L 15,=V(DSNHLI)
357 BALR 14,15
358 ***$$$
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|