View previous topic :: View next topic |
Author |
Message |
sarjushah Beginner
Joined: 27 Jul 2005 Posts: 2 Topics: 1
|
Posted: Wed Jul 27, 2005 2:06 pm Post subject: Packed data in easytrieve |
|
|
Hi,
I read a couple of previous post on packed data in eazytrieve but they were not able to solve my problem.
The input file is created using cobol prgram and the defination of the field is
VariableA PIC S9(07)V99 COMP-3.
I read this file in my eazytrieve program , The macro used for reading the file has the filed defination of
VariableA 5 P 2
I need to move this to my outfile. if the data value is 0000050.00 I need to send 000005000 in my out file or
if it is 0000123.45 I need to send 000012345 in my output file. Just simple unpacked data of 9 bytes length not packed.
What is the defination of the out put varibale i should use.
Please help. I have been juggling this one for couple of days now.
Thanks
Sarju |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Jul 27, 2005 2:25 pm Post subject: |
|
|
Sarjushah,
Cobol does not store the Decimal explicitly. So you can read the value as 5 P 0 and move it to 9 N 0 which is a numeric field.
ex:
Code: |
FILE INFILE
IN-VAL 01 5 P 0
FILE OUTFILE
OUT-VAL 01 9 N 0
JOB INFILE
OUT-VAL = IN-VAL
PUT OUTFILE
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
sarjushah Beginner
Joined: 27 Jul 2005 Posts: 2 Topics: 1
|
Posted: Wed Jul 27, 2005 2:54 pm Post subject: |
|
|
Hi,
If i use in file of 5 N 0 and and out file of 9 N 0 i get a SOC7
I also tried just using 9 N in my output variable but i got a soc7.
When I use 5 N 2 in my input file and 9 N 0 in out put I get a SOC7.
I worls file when i use 5 N 2 in input and 7 N 2 in out put
but I donot get the desiered results.
Please help
Thanks
Sarjushah |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Jul 27, 2005 5:07 pm Post subject: |
|
|
sarjushah,
Did you even read my post? Please see how I defined the input variable and how I defined the output variable.
Input is defined as packed i.e 5 P 0 and output is defined as numeric i.e 9 N 0
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|