DSNTIAUL to access data at remote location

Fertaki Gina

DSNTIAUL to access data at remote location
Hello everyone,
we have a DRDA connection between our DB2 V4 and DB2/400 up and running.
I did a bind of DSNTIAUL as an application package both at local DB2 and at
AS/400.
I then try to unload a DB2 table from AS/400 by running DSNTIAUL using
PARM('SQL') and doing:

a) CONNECT TO location ; (returns SQLCODE = 000, SQLSTATE = 00000,
UNQUALIFIED SUCCESSFUL COMPLETION)
b) SELECT * from qualifier.table ; (returns -104, SQLSTATE = 42601, SYNTAX
ERROR OR ACCESS RULE VIOLATION FROM OS/400 TOKENS ; <END-OF-STATEMENT>

If I look at the AS/400 log of the remote job it says :
"Token ; was not valid. Valid tokens: <END-OF-STATEMENT>."
It seems that the ; at the end of the SELECT statement is not recognized by
the AS/400 system.
If I take it out it still doesn't work.
What would be a valid end of statement for AS/400 ?
Any help would be greatly appreciated.
Gina Fertaki
DBA
EFG Eurobank SA
Greece



Roger Miller

Re: DSNTIAUL to access data at remote location
(in response to Fertaki Gina)
DSNTIAUL depends upon the parser to find the semicolons, and the specific
code
is only in the DB2 for OS/390 parser. You can use the option to specify
only the
table name, or you can put in code to find the semicolon yourself.

Roger Miller



Fertaki Gina

Re: DSNTIAUL to access data at remote location
(in response to Roger Miller)
Although If I do exactly the same with the DSNTEP2 program, AS/400
recognizes the semicolumns
and returns data. The problem is that the data is in a report format and not
in UNLOAD format as
desired.
Gina Fertaki
-----Original Message-----
From: Roger Miller [mailto:[login to unmask email]
Sent: Monday, December 20, 1999 7:08 PM
To: [login to unmask email]
Subject: Re: DSNTIAUL to access data at remote location


DSNTIAUL depends upon the parser to find the semicolons, and the specific
code
is only in the DB2 for OS/390 parser. You can use the option to specify
only the
table name, or you can put in code to find the semicolon yourself.

Roger Miller








Roger Miller

Re: DSNTIAUL to access data at remote location
(in response to Fertaki Gina)
That's right. DSNTEP2 has code to find the semicolon. If you translate
that into
assembler to find the semicolon, then the DSNTIAUL program will work with
other
platforms. We couldn't convince other platforms to implement the returned
information about the ending semicolon. The complete job of searching for
tokens is very complex.

Roger



Fertaki Gina

Re: DSNTIAUL to access data at remote location
(in response to Roger Miller)
Thank you for all your answers.
What do you mean by using the option to specify only the table name?
Do you mean omitting the PARM('sql') keyword? If yes, I believe that then I
cannot use the
CONNECT TO statement before selecting, or is it something else that I am
missing?
Gina Fertaki

-----Original Message-----
From: Roger Miller [mailto:[login to unmask email]
Sent: Monday, December 20, 1999 7:08 PM
To: [login to unmask email]
Subject: Re: DSNTIAUL to access data at remote location


DSNTIAUL depends upon the parser to find the semicolons, and the specific
code
is only in the DB2 for OS/390 parser. You can use the option to specify
only the
table name, or you can put in code to find the semicolon yourself.

Roger Miller








[login to unmask email]

Re: DSNTIAUL to access data at remote location
(in response to Fertaki Gina)
Gina,

Try using the three part name (location.creator.name) or setup an alias
that points to the remote table. Then use the name/alias in the unload
without the parm('sql').

HTH,
Jay


Jay Reavill
[login to unmask email]
IBM Global Services
Tampa, Florida
Tel: (813) 878-3525, Tie Line 8-427-3525
-----------------------------------------------------
Happiness is not around the corner.
Happiness is the corner.
- BMW
-----------------------------------------------------


Fertaki Gina <[login to unmask email]>@RYCI.COM> on 12/22/99 03:49:35 AM

Please respond to DB2 Data Base Discussion List <[login to unmask email]>

Sent by: DB2 Data Base Discussion List <[login to unmask email]>


To: [login to unmask email]
cc:
Subject: Re: DSNTIAUL to access data at remote location



Thank you for all your answers.
What do you mean by using the option to specify only the table name?
Do you mean omitting the PARM('sql') keyword? If yes, I believe that then I
cannot use the
CONNECT TO statement before selecting, or is it something else that I am
missing?
Gina Fertaki

-----Original Message-----
From: Roger Miller [mailto:[login to unmask email]
Sent: Monday, December 20, 1999 7:08 PM
To: [login to unmask email]
Subject: Re: DSNTIAUL to access data at remote location


DSNTIAUL depends upon the parser to find the semicolons, and the specific
code
is only in the DB2 for OS/390 parser. You can use the option to specify
only the
table name, or you can put in code to find the semicolon yourself.

Roger Miller



the










Fertaki Gina

DSNTIAUL to access data at remote location
(in response to damcon2@US.IBM.COM)
Hi Jay,
I tried the three part name when accessing DB2 at AS/400, but it did not
work. It seems that System-directed access is available only to Version 2.3
and later versions of DB2 for MVS/ESA and not for other members of the DB2
family of IBM products as stated in the "DB2 for MVS/ESA Application
Programming and SQL Guide".
Since I don't know assembler it is difficult to write code for the semicolon
as well, so I will probably give up on this solution.
Anyway,thanks for all your answers and I wish Merry Christmas to all of you!

Gina Fertaki-DBA
EFG Eurobank SA
Greece