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

DB2 SPUFI amounts presentation vs. DB2 Batch amounts present


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1788
Location: Bloomington, IL

PostPosted: Sat Dec 08, 2012 3:40 am
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: 765
Location: Whitby, ON, Canada

PostPosted: Sat Dec 08, 2012 3:59 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
Search our Forums:

Back to Top