View previous topic :: View next topic
|
Author |
Message |
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
I have a field in my input file with PIC 9(03) but DB2 table structure has SMALLINT for the same field. So, I want to change 9(03) value into
S9(04) COMP.
Can we do this through DFSORT? Please let me know if this can be possible in any other way.
Record Length: 100, Format: FB, field position is 29-31 and this should be chnaged to 29-30.
My input data looks like below.
2----+----3----+--
************** Top
0..r%....004VAIB02
Here my value for TIER_NBR is '004', is starting at 29 and ending at 31 but DB2 load card looks like below.
TIER_NBR POSITION( 29 )
SMALLINT,
PRGRAM_UPDATE POSITION( 31 )
CHAR( 08) ,
Here TIER_NBR is starting at 29 and ending at 30 and Program update is starting at 31 (in my example VAIB....). But in my input file Program Update is starting at 32. I want to restrict TIER_NBR into 2 digits only.
Regards,
KSK |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I want to restrict TIER_NBR into 2 digits only |
Is this correct or should the size be 2 bytes rather than 2 digits? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
KSK,
You can use DFSORT control statements like the following to do what you asked for. I didn't know what you wanted after the PROGRAM_UPDATE field (if anything) so I showed that as ...
Code: |
OPTION COPY
INREC BUILD=(1,28,29,3,ZD,TO=BI,LENGTH=2,31:32,8,...)
|
|
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Dick,
yes, you are right, it should be 2 bytes not 2 digits.
Frank,
Thanks for your solution, it is working.
Regards,
KSK |
|
Back to top |
|
|
|