MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Packed data in easytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sarjushah
Beginner


Joined: 27 Jul 2005
Posts: 2
Topics: 1

PostPosted: Wed Jul 27, 2005 2:06 pm    Post subject: Packed data in easytrieve Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Jul 27, 2005 2:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
sarjushah
Beginner


Joined: 27 Jul 2005
Posts: 2
Topics: 1

PostPosted: Wed Jul 27, 2005 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Jul 27, 2005 5:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group