|
|
| Author |
Message |
gauravgupta2808 Warnings : 1 New User
Joined: 31 May 2007 Posts: 31 Location: Chennai, India
|
|
|
|
Hi,
I have a copybook of the following layout:
| Code: |
01 :TAG:-TGDEBTP.
03 :TAG:-TGDEBTP-DATA.
05 :TAG:-TGY6CE PIC X(2).
05 :TAG:-TGY7CE PIC X(1).
05 :TAG:-TGY8CE PIC X(2).
05 :TAG:-TGJENC PIC S9(5) COMP-3.
05 :TAG:-TGHFTT PIC X(40).
05 :TAG:-TGHGTT PIC X(40). |
Field TGJENC is not available in TGDEBTP table. I have to initialize it to zeroes while unloading.
My DB2 Unload Card is of type:
| Code: |
* CONTROL CARD
UNLOAD
DIRECT AUTO
SELECT
TGY6CE,
TGY7CE,
TGY8CE,
CHAR('00000'),
TGHFTT,
TGHGTT
FROM TGDEBTP; |
By unloading using above data card, I am unable to get the expected layout as per copybook.
I have tried using CAST. that also didnt work
Could Some one please help me.
Thank you
Gaurav |
|
| Back to top |
|
 |
References
|
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1671 Location: germany
|
|
|
|
| CHAR(X'000000000C') |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9187 Location: 221 B Baker St
|
|
|
|
Hello,
You have used a "pic x(5)" value when you specified "CHAR('00000'),".
Try just using "00000," (wthout the quotes). |
|
| Back to top |
|
 |
gauravgupta2808 Warnings : 1 New User
Joined: 31 May 2007 Posts: 31 Location: Chennai, India
|
|
|
|
Hi,
Just "00000" was not giving expected results.
Finally I have used,
CAST(CHAR(X'F0') AS DECIMAL(5,0))
This has hit performance, but its giving expected output even cases where I have to initialize S9(3)V9(2) COMP-3. fields
Thank you all for suggestions |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9187 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| Just "00000" was not giving expected results. |
What result was given?
Did you try the suggestion from dbz? When you try it, make sure to use the required number of zeros (as dbz did). An implied decimal should cause no problem.
| Quote: |
| This has hit performance |
How was this measured? It appears that the most costly way to do the job was chosen. If this is a one-time process, probably not an issue. If this is part of some regular run, and you can actually see a performance hit, it would probably one a good idea to change the process. |
|
| Back to top |
|
 |
|
|