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
 

 

DB2 SPUFI amounts presentation vs. DB2 Batch amounts present

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Sat Dec 08, 2012 3:30 am    Post subject: DB2 SPUFI amounts presentation vs. DB2 Batch amounts present
Reply with quote

When I run a DB2 SPUFI the amount fields are presended in an easy-to-read fashion (see SPUFI RESULTS).

When I run a DB2 Batch job with the same SPUFI Select, the amount fields are not presended in an easy-to-read fashion exactly like SPUFI (see BATCH RESULTS and/or BATCH RESULTS IN HEX). The amount field is packed obviously. Is there an easy "trick" to present the Batch job amount like the SPUFI amount?

Thank you.

SPUFI RESULTS:
Code:
---------+---------+---------+---------+---------+ 
   SELECT THE_AMT                                   
         ,FIRST_NAME                               
     FROM DB2TEST.THE_TABLE                         
     WHERE THE_AMT >  01                         
       WITH UR                                     
   ;                                               
---------+---------+---------+---------+---------+ 
   THE_AMT  FIRST_NAME                             
---------+---------+---------+---------+---------+ 
     70.90  ELLEN                                   
     49.94  WILLIAM                                 
     49.47  JOHN                                   
     70.90  ROBERT                                 
     34.16  BARBARA     


BATCH RESULTS:
Code:
----+----1----+----2----+----3
.....ELLEN                   
...R<WILLIAM                 
...M@JOHN                     
.....ROBERT                   
... %BARBARA                 


BATCH RESULTS IN HEX:
Code:
----+----1----+----2----+----3 
.....ELLEN                    .
00000CDDCD444444444444444444440
0079C53355000000000000000000000
 ------------------------------
...R<WILLIAM                  .
00094ECDDCCD4444444444444444440
0049C69339140000000000000000000
 ------------------------------
...M@JOHN                     .
00097DDCD4444444444444444444440
0044C16850000000000000000000000
 ------------------------------
.....ROBERT                   .
00000DDCCDE44444444444444444440
0079C96259300000000000000000000
 ------------------------------
... %BARBARA                  .
00046CCDCCDC4444444444444444440
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1755
Location: Bloomington, IL

PostPosted: Sat Dec 08, 2012 3:40 am    Post subject:
Reply with quote

Depends on your definition of "easy". SPUFI is, of course, doing extra work (not a lot of extra work, but some) to detect the column type and format the result for readbility. DSNTEP2/4 (the IBM-provided program for running dynamic SQL in batch) do much the same thing; you can adapt that portion of the program to your needs.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 650
Location: Whitby, ON, Canada

PostPosted: Sat Dec 08, 2012 3:59 am    Post subject:
Reply with quote

Looks like you are running DSNTIAUL to process your query. DSNTIAUL is not designed to produce human readable output.

Either use DSNTEP2/4 as has already been suggested, or you have to alter your query to convert the DECIMAL and Integer fields.

Hint: SELECT DIGITS(THE_AMOUNT), .....etc

If you want headings in your output, then use DSNTEP2/4. There is no batch program (that I know of) that produces exactly the same output as SPUFI, but most people find that TEP2/4 comes close enough.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Mon Dec 10, 2012 8:38 pm    Post subject:
Reply with quote

Thank you both.

Yes, I was using DSNTIAUL since I was putting the results in DD-SYSREC00. DSNTEP2 worked well putting my results to DD-SYSPRINT.
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 HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
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