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
 

 

how to make column readable from dynamic SQL results?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: how to make column readable from dynamic SQL results?
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>>@ http://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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Mon Sep 26, 2011 2:03 pm    Post subject: Reply to: how to make column readable from dynamic SQL resul
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    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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am


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