From: Robert on
On Thu, 31 Jan 2008 10:35:24 +0000 (UTC), docdwarf(a)panix.com () wrote:

>In article <29n2q3p0caoh922pmsenajrl1niln3j4m3(a)4ax.com>,
>Robert <no(a)e.mail> wrote:
>>On Thu, 31 Jan 2008 17:38:23 +1300, "Pete Dashwood"
>><dashwood(a)removethis.enternet.co.nz>
>>wrote:
>>
>>>
>>>
>>>"Robert" <no(a)e.mail> wrote in message
>>>news:jof2q31shvbu6d9ia1i7gelptabq9slahe(a)4ax.com...
>>>> On Wed, 30 Jan 2008 10:39:28 -0700, "Frank Swarbrick"
>>>> <Frank.Swarbrick(a)efirstbank.com>
>>>> wrote:
>>>>
>>>>>--------------------------------------------------------------------
>>>>> SQL0060W The "COBOL" precompiler is in progress.
>>>>> 19 SQL0008N The token "occurs" found in a host variable
>>>>> declaration is not valid.
>>>>> 41 SQL4943W The number of host variables in the INTO clause
>>>>> is not the same as the number of items in the SELECT
>>>>> clause. SQLSTATE=01503
>>>>
>>>> The manual says DB2 doesn't allow a simple SELECT to return multiple rows.
>>>> You must do the
>>>> SELECT in a cursor declaration and read the table with a single FETCH, as
>>>> illustrated by
>>>> Frederico.
>>>>
>>>> Thanks for the experiment.
>>>>
>>>
>>>While I don't claim the same level of SQL knowledge that you have
>>>demonstrated, Robert, I have managed to use it successfully for a number of
>>>years.
>>>
>>>Obviously you CAN return multiple rows from a query if you can process a
>>>result set, however, in embedded SQL I've always used the cursor and FETCHed
>>>it.
>>
>>Many Cobol programmers think it's not possible to get a result set,
>>except by FETCHing one
>>row at a time. They regard a database as VSAM on drugs.
>
>Ummmmm... many COBOL programmers I know work with DB2, Mr Wagner; didn't
>you mention something about what the manual said regarding this in another
>post?

I said above that a simple SELECT is limited to one row, a FETCH is not.

>(I have, certainly, seen DB2 installations where the database is treated
>in programs as though it were VSAM... and then a few of the 'power users'
>get access and training in QMF (training for the programmers usually
>consisted of 'The managers went to the classes... and they slept; here's a
>manual and remember, we're trying to keep things as much in The Old Way as
>possible') and rather... pretty confrontations could result.)

Manuals are as close as your Web browser.

Offshore programmers aren't guardians of the Old Way. Maybe that's why they're doing so
well.
From: Robert on
On Thu, 31 Jan 2008 14:42:11 +0000 (UTC), docdwarf(a)panix.com () wrote:

>In article <mkj3q3pmtvmn64pjnhk0s3mfcgplas1hcs(a)4ax.com>,
>Robert <no(a)e.mail> wrote:
>>On Thu, 31 Jan 2008 10:26:34 +0000 (UTC), docdwarf(a)panix.com () wrote:
>>
>>>In article <gfl2q319rd84spnb10q3f9huuvjq2254f9(a)4ax.com>,
>>>Robert <no(a)e.mail> wrote:
>>>>On Thu, 31 Jan 2008 01:37:24 +0000 (UTC), docdwarf(a)panix.com () wrote:
>>>>
>>>>>In article <bav1q3t26jjt26156j9eh4lpp1ivtot9a0(a)4ax.com>,
>>>>>Robert <no(a)e.mail> wrote:
>>>>
>>>>>>>That's similar to a way I have seen things done on mainframes, yes... but
>>>>>>>a way that would not pass muster in more than a few shops where I've
>>>>>>>worked and would have gotten you laughed out of Prod Implementation
>>>>>>>reviews.
>>>>>>
>>>>>>I've never seen a Prod Implementation review. I've only seen reviews
>>>>>>BEFORE testing began.
>>>>>>Sounds like you're putting untested rewrites into production.
>>>>>
>>>>>That might be due to the fact that it is something you admit to being
>>>>>outside of your experience, Mr Wagner; a Prod Implementation review can
>>>>>require a programmer to submit test results.
>>>>
>>>>In my experience, test results are checked by TEST TEAMS, who run pair,
>>>>integration,
>>>>system, regression and performance tests. Each test case is evidenced by
>>>>a document
>>>>showing expected versus actual, and signed in blood.
>>>
>>>Now think of expanding your experience, Mr Wagner... and imagine that the
>>>TEST TEAM (caps original) makes a copy of their documentation... and
>>>returns it (in exchange for a signature, of course), to the programmer...
>>
>>Tests plans and results, along with all other project documentation,
>>reside in a framework
>>repository that's accessible to everyone. There is no reason to print them out.
>
>Mr Wagner, in 'more than a few shops where I have worked' such things were
>not always available; that was the reason to print them out.

It's hard to believe they don't have a network connecting desktop PCs. Make a public
directory on any machine. Use directories to create a framework.

>>>who brings this stack o' foolscap along when he sits down with other folks
>>>at a Prod Implementation meeting.
>>
>>Our meetings are held in cyberspace using NetMeeting or similar.
>>Participants are all over
>>the world; they are not sitting in a room.
>
>Not everyone's meetings were what your meetings are, Mr Wagner... you do
>realise that 'where I have worked' might encompass a portion of space/time
>that's more than a few decades past, don't you?

Check your calendar. It may be running slow.

From: Richard on
On Feb 1, 5:29 pm, Robert <n...(a)e.mail> wrote:
> On Thu, 31 Jan 2008 14:42:11 +0000 (UTC), docdw...(a)panix.com () wrote:
> >In article <mkj3q3pmtvmn64pjnhk0s3mfcgplas1...(a)4ax.com>,
> >Robert <n...(a)e.mail> wrote:
> >>On Thu, 31 Jan 2008 10:26:34 +0000 (UTC), docdw...(a)panix.com () wrote:
>
> >>>In article <gfl2q319rd84spnb10q3f9huuvjq225...(a)4ax.com>,
> >>>Robert <n...(a)e.mail> wrote:
> >>>>On Thu, 31 Jan 2008 01:37:24 +0000 (UTC), docdw...(a)panix.com () wrote:
>
> >>>>>In article <bav1q3t26jjt26156j9eh4lpp1ivtot...(a)4ax.com>,
> >>>>>Robert <n...(a)e.mail> wrote:
>
> >>>>>>>That's similar to a way I have seen things done on mainframes, yes... but
> >>>>>>>a way that would not pass muster in more than a few shops where I've
> >>>>>>>worked and would have gotten you laughed out of Prod Implementation
> >>>>>>>reviews.
>
> >>>>>>I've never seen a Prod Implementation review. I've only seen reviews
> >>>>>>BEFORE testing began.
> >>>>>>Sounds like you're putting untested rewrites into production.
>
> >>>>>That might be due to the fact that it is something you admit to being
> >>>>>outside of your experience, Mr Wagner; a Prod Implementation review can
> >>>>>require a programmer to submit test results.
>
> >>>>In my experience, test results are checked by TEST TEAMS, who run pair,
> >>>>integration,
> >>>>system, regression and performance tests. Each test case is evidenced by
> >>>>a document
> >>>>showing expected versus actual, and signed in blood.
>
> >>>Now think of expanding your experience, Mr Wagner... and imagine that the
> >>>TEST TEAM (caps original) makes a copy of their documentation... and
> >>>returns it (in exchange for a signature, of course), to the programmer...
>
> >>Tests plans and results, along with all other project documentation,
> >>reside in a framework
> >>repository that's accessible to everyone. There is no reason to print them out.
>
> >Mr Wagner, in 'more than a few shops where I have worked' such things were
> >not always available; that was the reason to print them out.
>
> It's hard to believe they don't have a network connecting desktop PCs. Make a public
> directory on any machine. Use directories to create a framework.

You appear to miss completely the point of English having tenses.

'worked' may refer to 1972, which would have made your reference to
'desktop PCs', 'network' and 'public directory' rather mystifying to
them at that time. I am not sure how Doc would know what they do at
this, or any intermediate, time.


> >>>who brings this stack o' foolscap along when he sits down with other folks
> >>>at a Prod Implementation meeting.
>
> >>Our meetings are held in cyberspace using NetMeeting or similar.
> >>Participants are all over
> >>the world; they are not sitting in a room.
>
> >Not everyone's meetings were what your meetings are, Mr Wagner... you do
> >realise that 'where I have worked' might encompass a portion of space/time
> >that's more than a few decades past, don't you?
>
> Check your calendar. It may be running slow.

You may find this useful:

http://en.wikipedia.org/wiki/Past_tense

From: William M. Klein on
In addition to Robert's manual reference, you might want to see:
"Using a multiple-row FETCH statement with host variable arrays" at
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnapk10/2.2.2.4.1

and

"Declaring host variable arrays in COBOL" at
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnapk10/2.4.3.6

If it matters, the latter does NOT (seem to me) to allow for OCCURS DEPENDING
ON.

and

the FETCH syntax information at:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnsqk10/5.65


--
Bill Klein
wmklein <at> ix.netcom.com
"Robert" <no(a)e.mail> wrote in message
news:kn65q3pual2uooc5j7skq4vm1mvatp4imq(a)4ax.com...
> On Thu, 31 Jan 2008 17:27:50 -0700, "Frank Swarbrick"
> <Frank.Swarbrick(a)efirstbank.com>
> wrote:
>
>>>>> On 1/31/2008 at 5:17 PM, in message
>><c3p4q3tji85k6tegudomp2k4f4bmtk744o(a)4ax.com>, Robert<no(a)e.mail> wrote:
>>> On Thu, 31 Jan 2008 11:56:10 -0700, "Frank Swarbrick"
>>> <Frank.Swarbrick(a)efirstbank.com>
>>> wrote:
>>>
>>>> SQL0060W The "COBOL" precompiler is in progress.
>>>> 19 SQL0008N The token "occurs" found in a host variable
>>>> declaration is not valid.
>>>> 51 SQL0306N The host variable "TABLE2-ENTRY" is undefined.
>>>> SQL0095N No bind file was created because of previous
>>>> errors.
>>>> SQL0091W Precompilation or binding was ended with "3"
>>>> errors and "0" warnings.
>>>>
>>>>I also tried this and got the same error
>>>> 05 table2-entry occurs 100.
>>>>
>>>>Now of course you can remove the occurs, but then you're stuck with
>>> fetching
>>>>one row at a time.
>>>>
>>>>I see no way to do a multi row (at once) fetch using DB2/LUW.
>>>>
>>>>More thoughts would be welcome.
>>>
>>> I believe this will work for sure:
>>>
>>> 05 table2-entry.
>>> 10 t2-name pic x(30) occurs 100.
>>> 10 t2-dept pic x(04) occurs 100.
>>>
>>> fetch t2_curs
>>> into :t2-name, :t2-dept
>>
>>Nope. I tried that one too.
>>
>>LINE MESSAGES FOR tabtest.sqb
>>------
>>--------------------------------------------------------------------
>> SQL0060W The "COBOL" precompiler is in progress.
>> 21 SQL0314N The host variable "t2-name" is incorrectly
>> declared.
>> 22 SQL0314N The host variable "t2-dept" is incorrectly
>> declared.
>> 20 SQL4007N The host structure "table2-entry" has no fields.
>> 18 SQL4007N The host structure "table2-area" has no fields.
>> 51 SQL0104N An unexpected token "t2_curs" was found following
>> "<identifier>". Expected tokens may include: "INTO".
>> SQL0095N No bind file was created because of previous
>> errors.
>> SQL0091W Precompilation or binding was ended with "6"
>> errors and "0" warnings.
>
> Here is an sample from the IBM DB2 manual:
>
> EXEC SQL
> FETCH NEXT ROWSET FROM EMPSET
> FOR :SIZE-ROWSET ROWS
> INTO :HVA-EMPNO, :HVA-LASTNAME, -- defined with occurs
> :HVA-WORKDEPT, :HVA-JOB
> END-EXEC.
>
> http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.apsg/db2z_xmpsfetchingrowscursor.htm
>
> DB2 Version 9.1 for z/OS
>


From: Frederico Fonseca on
On Fri, 01 Feb 2008 06:28:17 GMT, "William M. Klein"
<wmklein(a)nospam.netcom.com> wrote:

>In addition to Robert's manual reference, you might want to see:
> "Using a multiple-row FETCH statement with host variable arrays" at
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnapk10/2.2.2.4.1
>
> and
>
> "Declaring host variable arrays in COBOL" at
>http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnapk10/2.4.3.6
>
>If it matters, the latter does NOT (seem to me) to allow for OCCURS DEPENDING
>ON.
>
>and
>
>the FETCH syntax information at:
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnsqk10/5.65

The above syntax does not work on Windows/Unix versions.
There is no concepts of multiple-row fetch/insert on those versions,
unless using CLI code (DB2 API)

This wont help Frank, or anyone else, using DB2 for Windows as he is.


Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com