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

Joined: 01 Aug 2005 Posts: 12 Topics: 4 Location: India
|
Posted: Tue Aug 02, 2005 8:09 am Post subject: SOC 7 ... |
|
|
Hi All,
Let me start with putting down my requirement. In the input file to my program i have a field which is defined as
WS-A PIC S9(08)V99.
Now this field has its leading bytes as spaces in the file.
I have two operations with this field :
1. To display on a screen.
2. To compute some values using this.
The program is failing with SOC 7 at the compute point. I tried putting an inspect asking to replace leading spaces by zeros. But it corrupts the data. The reason being hex of space is '40' and for the v in S9(08)V99 the hex value is '4b'. This inspect will even covert this V.
So can anybody please suggest how can i remove the leading spaces in the field so that i can compute on it and at the same time retain the original value in it for display. _________________ Cheers,
Vikas |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Aug 02, 2005 8:15 am Post subject: |
|
|
Quote: |
In the input file to my program i have a field which is defined as WS-A PIC S9(08)V99.
|
vikaspaniker79,
So how does your input file look like for this field?
Code: |
+ 678.11
-12345678.90
|
If so first read the contents with the sign into a char field and then reformat the field
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
vikaspaniker79 Beginner

Joined: 01 Aug 2005 Posts: 12 Topics: 4 Location: India
|
Posted: Fri Aug 05, 2005 12:07 am Post subject: |
|
|
Thanks for the reply ...
but i believe it wont work since if i move it into a char field, i can no more perform computation on it ....
Well at last i have got a solution on it ...
For the first part.. i have put a inspect for the first 7 byte i.e INSPECT
WS-A(1:8 )
For the second part ... I stringed the variable the first 7 and last two byte into the new variable ..well to mention here my computaion was to remove the '.' i.e to multiply by 100..... _________________ Cheers,
Vikas |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
vivek Beginner
Joined: 15 Jul 2004 Posts: 95 Topics: 11 Location: Edison,NJ
|
Posted: Mon Aug 15, 2005 1:35 pm Post subject: |
|
|
Vikas, you use sign trailing separate clause. _________________ Vivek,NJ
Db2,IDMS |
|
Back to top |
|
 |
|
|