Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1777
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: 658
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 sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Generate public-private key in batch ... vasanthz All Other Mainframe Topics 3 Fri Sep 15, 2017 9:20 am
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us