View previous topic :: View next topic |
Author |
Message |
yugee Beginner

Joined: 17 Sep 2005 Posts: 25 Topics: 8
|
Posted: Sun Jan 08, 2006 3:11 am Post subject: Converting Signed numeric field to Comp-3 using Easytrieve |
|
|
Hi,
I have an input file which has a field. I want to load the field to data base which has a different declaration. My problem is to convert the field format to suit the database format.
This is my field format in input file:
total of 17 bytes (13,2). (PIC +9(13).(2))
for example: -0000001234234.34
In data base we have declared the field as Decimal(15,2). which becomes
PIC S9(13)V9(2) USAGE COMP-3.
it will occupy 8 bytes.
So, i want to convert the field with 17 bytes to 8 bytes.
Could any one please help me to conver this using EASYTRIEVE. Is there any other way we can do this.I don't want to write a COBOL program just for this.
Thanks,
Yugee |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sun Jan 08, 2006 8:49 am Post subject: |
|
|
Yugee,
Please post your question only once and in only one forum. When you post the same question in multiple forums, you can cause confusion and frustration for the people that are attempting to help you. Use meaningful topic titles. "Converting signed numeric field to packed decimal using Easytrieve" would an approriate title.
Second Please search before posting. This has been discussed earlier. Check this link
http://www.mvsforums.com/helpboards/viewtopic.php?p=24520#24520
Just change the definitions to the following
Code: |
FILE INFILE
AMT-S 01 001 A
AMT-NUM * 013 N
AMT-DOT * 001 A
AMT-DEC * 002 N
W-NUM W 15 N 0
W-AMT1 W-NUM 13 N 0
W-AMT2 W-NUM +13 02 N 0
FILE OUTPUT FB(0 0)
O-AMT 01 8 P 2
|
Hope this helps...
Cheers
Kolusu
PS: I am deleting your duplicate post in Utilities forum and changing the title also. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
vst Beginner
Joined: 23 Jan 2006 Posts: 11 Topics: 0
|
|
Back to top |
|
 |
|
|