IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Records are there but giving Sqlcode 100 in Spufi


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lalitha.rayala5

New User


Joined: 25 Aug 2010
Posts: 10
Location: Bangalore, India

PostPosted: Fri May 13, 2011 6:13 pm
Reply with quote

Hi,

Can anyone please clarify my issue below.

I am running the below query in Spufi. In the output dataset 1 record is being displayed but showing Sqlcode 100. Please let me how this happens.

SELECT distinct
WIDTH
,SUFFIX_LGTH_REQ
,CMDTY_CODE_DESC_1
,CMDTY_CODE_DESC_2
,SUFFIX_REQUIRED
FROM
P.TA0001
WHERE
COMMODITY_CODE = '123519'
AND SUFFIX = '099'


output dataset:

---------+---------+---------+---------+---------+---------+---------+
WIDTH SUFFIX_LGTH_REQ CMDTY_CODE_DESC_1
---------+---------+---------+---------+---------+---------+---------+
.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
DSNE610I NUMBER OF ROWS DISPLAYED IS 2
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100


Thanks,
Lalitha Rayala.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri May 13, 2011 6:30 pm
Reply with quote

it happens ( that You are wondering ) because You did not care to read the manuals/doc

even a simple googling with spufi sql code 100 will return a pointer which answers Your question properly

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.apsg/xf4d5c.htm
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri May 13, 2011 6:38 pm
Reply with quote

Quote:
Please let me how this happens


More than likely:

1) Your where clause is incorrect for the datatype of the columns

2) You are not connected to the correct db2 subsystem

3) Your table qualifier is incorrect

Make your vote....
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri May 13, 2011 6:48 pm
Reply with quote

the sql code 100 is a SUCCESS SQL CODE, not an error one

it happens because SPUFI blindly display the sql code from the <last executed> command

a sql code 100 is like the EOF indicator ...
fetch, fetch, ... , fetch with sql code 100 ==> no more rows ( end of file / no more rows )


in COBOL ( plain file access )
read, read, .... , read and raise the EOF condition ( end of file / no more records )

the general logic is the same in bothe cases
the query/read was <successful> it's up to the program to determine if any rows were returned or if any records were read
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri May 13, 2011 6:51 pm
Reply with quote

Thank you Enrico,

I could not see the forrest for the trees.

The rows were found and displayed:

Code:

.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
DSNE610I NUMBER OF ROWS DISPLAYED IS 2
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts DELETE SPUFI DB2 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top