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

how to make column readable from dynamic SQL results?


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

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Sep 26, 2011 1:30 pm
Reply with quote

I have coded a program based on a redbook named:<< DB2 for z/OS and OS/390 : Squeezing the Most Out of Dynamic SQL>>@ www.redbooks.ibm.com/abstracts/sg246418.htmlf,

I'm using VARYING-LIST SELECT WITHOUT PARMS

but viewing from the result, I found a problem: columns defined as INTEGER, BIGINT, SMALLINT and ect cannot be displayed normally just as QMF and SPUFI does.

for example, below is what dynamic SQL result shows:
Code:
 BROWSE    TMAP011.SQL.OUTPUT@               
********************************* Top of Data
00000000000000001..11111111111111111000001   
1                ..1                1 1     
11111111111111111..11               1111     
1234567          ..1                1 1     
12               ..1                3 1     
13               ..1                1 1     



and below is the SPUFI result:
Code:
 BROWSE    TMAP011.SPUFI.OUT                     
----+----1----+----2----+----3----+----4----+----5
********************************* Top of Data ****
---------+---------+---------+---------+---------+
SELECT * FROM SCNXTAB.SDKMAST                     
---------+---------+---------+---------+---------+
BSAC               BSAC_SEQNO  PDAC               
---------+---------+---------+---------+---------+
00000000000000001           1  11111111111111111 
1                           1  1                 
11111111111111111          11  11                 
1234567                     1  1                 
12                          1  1                 
13                          1  1                 
11111111111111112           0  1111               
11111111111111113           1  1                 
22                          2  2                 
2                           1  1                 


in above results, we can see that column: BSAC_SEQNO, which is defined as SMALLINT, starting from column 18, can be displayed normally by SPUFI, while not good for dynamic SQL output(I know it's readable when 'HEX ON' command is issued.)

How to produce the same result as SPUFI does?
Would you please suggest how to resolve this issue?
Thanks in advance.

note that as I'm using VARYING-LIST SELECT WITHOUT PARMS, column numbers and types are not predictable by cobol program , thus we cannot declare variables for columns in WORKING-STORAGE section.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Sep 26, 2011 2:03 pm
Reply with quote

column numbers and types are not predictable by cobol program
wrong... the DESCRIBE and the SQLTYPES are there just for that

why not look at how DSNTEPx does it?
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 How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts trying to make sense of keylists TSO/ISPF 11
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top