Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Records are there but giving Sqlcode 100 in Spufi

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Records are there but giving Sqlcode 100 in Spufi
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Fri May 13, 2011 6:30 pm    Post subject: Reply to: Records are there but giving Sqlcode 100 in Spufi
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

http://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: 662
Location: Pennsylvania

PostPosted: Fri May 13, 2011 6:38 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Fri May 13, 2011 6:48 pm    Post subject: Reply to: Records are there but giving Sqlcode 100 in Spufi
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: 662
Location: Pennsylvania

PostPosted: Fri May 13, 2011 6:51 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us