|
View previous topic :: View next topic
|
| Author |
Message |
Gary McDowell
Active User
Joined: 15 Oct 2012 Posts: 139 Location: USA
|
|
|
|
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 |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
| 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 |
|
 |
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
 |
Gary McDowell
Active User
Joined: 15 Oct 2012 Posts: 139 Location: USA
|
|
|
|
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 |
|
 |
|
|