× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I think I found it - I switched these around and I in better shape (I
think):

SET MY-PTR UP BY LENGTH OF SQL-STATEMENT-TEXT-LEN
SET ADDRESS OF SQL-STATEMENT-TEXT2 TO MY-PTR

Scott



Scott Lindstrom
<SLindstrom@Pacti
v.com> To
Sent by: COBOL Programming on the
cobol400-l-bounce iSeries/AS400
s@xxxxxxxxxxxx <cobol400-l@xxxxxxxxxxxx>
cc

06/11/2009 11:05 Subject
AM Re: [COBOL400-L] reference to
variable fields in IBM copybooks

Please respond to
COBOL Programming
on the
iSeries/AS400
<cobol400-l@midra
nge.com>







I wanted to bring everyone up to date on my progress (and so the archives
have the benefit of my learning experience here).

I changed the code as Tom and Simon suggested. I have one basic problem at
this point. But first - here are are some snippets of the code:

LINKAGE SECTION.

01 SQL1-RETCODE PIC X.
COPY EZDAEP OF QSYSINC-QLBLSRC.
01 LIBNAME PIC X(10).
01 SQL-STATEMENT-TEXT2 PIC X(1024).

PROCEDURE DIVISION USING SQL1-RETCODE, QZDA-INIT-FORMAT.

set address of QZDA-NDB-FORMAT1 to
address of QZDA-INIT-FORMAT.
<snip>
set address of QZDA-SQL-FORMAT2 to
address of QZDA-INIT-FORMAT.

IF FORMAT-NAME
OF QZDA-SQL-FORMAT2 = 'ZDAQ0200'

SET MY-PTR TO ADDRESS OF SQL-STATEMENT-TEXT-LEN
OF QZDA-SQL-FORMAT2
SET ADDRESS OF SQL-STATEMENT-TEXT2 TO MY-PTR
SET MY-PTR UP BY LENGTH OF SQL-STATEMENT-TEXT-LEN

STRING TODAYS-DATE SPACE TODAYS-TIME SPACE
USER-PROFILE
OF QZDA-SQL-FORMAT2 '~'
SERVER-ID
OF QZDA-SQL-FORMAT2 '~'
FORMAT-NAME
OF QZDA-SQL-FORMAT2 '~'
FUNCTION-TEXT '~'
PACKAGE-NAME
OF QZDA-SQL-FORMAT2 '~'
PACKAGE-LIB-NAME
OF QZDA-SQL-FORMAT2 '~'
SQL-STATEMENT-TEXT2
(1:SQL-STATEMENT-TEXT-LEN)
DELIMITED BY SIZE INTO FD-ODBCLOG-RECORD

When I display "SQL-STATEMENT-TEXT2 (1:SQL-STATEMENT-TEXT-LEN)" in the
debugger it looks *almost* fine - but the contents of the SQL statement
do not get
'strung' into the output record. Everything is there but the
SQL-STATEMENT-TEXT2 itself.

I have tried DELIMITED BY '|' instead of DELIMITED BY SIZE just in case
that was the problem, but there was no change.

Any ideas at all what I am doing wrong?

Scott

--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing
list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.