Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Moving packed decimal field into a file using Easytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Thu Mar 26, 2009 3:32 pm    Post subject: Moving packed decimal field into a file using Easytrieve
Reply with quote

Hi,

I need to move a packed decimal field into a file. I tried moving it by copying it into a numeric field(so that it is readable) and then moving the numeric field into the file.

But the decimal point is not getting displayed in the file. I am using easytrieve.

Please help.

Thanks!
Back to top
View user's profile Send private message

anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu Mar 26, 2009 3:57 pm    Post subject: Reply to: Moving packed decimal field into a file using Easy
Reply with quote

Hello,
Please post the Declaration(Working storage) part of that Field so that we can help you.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 26, 2009 8:33 pm    Post subject:
Reply with quote

Hello,

This has nothing to do with Easytrieve. . .

There is no decimal point in a packed-decimal number.

Packed-decimal values contain some number of digits and the sign - nothing else.
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Fri Mar 27, 2009 7:22 am    Post subject: Re: Moving packed decimal field into a file using Easytrieve
Reply with quote

nightbuzzz wrote:
Hi,

I need to move a packed decimal field into a file. I tried moving it by copying it into a numeric field(so that it is readable) and then moving the numeric field into the file.

But the decimal point is not getting displayed in the file. I am using easytrieve.

Please help.

Thanks!


Iirc, Easytrieve doesn't format files, it formats reports. So if you want to format output (with decimal points, dollar signs etc...) you have to do some funky stuff to create a report with no heading, no footer, no column headings, no summary lines etc... ymmv.
Back to top
View user's profile Send private message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Fri Mar 27, 2009 2:59 pm    Post subject: Reply to: Moving packed decimal field into a file using Easy
Reply with quote

Yes, It looks like easytrive doesn't allow formatting of files.

I have used an array and inserted the decimal point manually.

Thanks for your time!
Back to top
View user's profile Send private message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Fri Mar 27, 2009 7:49 pm    Post subject: Reply to: Moving packed decimal field into a file using Easy
Reply with quote

Hi,

I have to get the data from a DB2 table and put it into a PS using easytrieve.

The column in DB2 table is defined as Decimal(14,2). I moved this field into a working storage numeric field (14 N 2). Now when I am moving this field into the PS file, the decimal point is not getting copied. I tried formatting it (like 999999.99), but even then the decimal point is missing in the final output.

Eg: Value in DB2 table : 1500.00
Value in the PS after copying: 150000 (decimal point is missing)

I need 1500.00 in the output file. How do I do it?

Thanks!
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Mar 27, 2009 8:17 pm    Post subject:
Reply with quote

Quote:
column in DB2 table is defined as Decimal(14,2). I moved this field into a working storage numeric field (14 N 2). Now when I am moving this field into the PS file, the decimal point is not getting copied. I tried formatting it (like 999999.99), but even then the decimal point is missing in the final output.


Eg: Value in DB2 table : 1500.00

Packed Decimal, Decimal (DB2), Comp-3 (COBOL) fields do not include an actual decimal point.
.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 27, 2009 11:41 pm    Post subject:
Reply with quote

Hello,

Said a bit differently - you can have a packed-decimal field or you can have a decimal point.

You cannot have both in the same field.

Why do you believe there is a requirement to have a packed-decimal field with an embedded decimal point?
Back to top
View user's profile Send private message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Mon Mar 30, 2009 11:06 am    Post subject: Reply to: Moving packed decimal field into a file using Easy
Reply with quote

Hi,

Let's forget about packed demical for the moment.

If I have field say W-VAR with value 145673. Now, I want to move this field into a PS file but with a decimal point.
E.g: 1456.73

How can we do this using easytrieve? I tried using masking (like 9999.99) - while displaying the field its displaying with the decimal point but when I am moving this field into the file, decimal point is not getting copied.

e.g:

Display w-var Result: 1456.73
File_field = w-var
put file_name
Result in the file : 145673

I hope my question is clear.

Thanks
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Mar 30, 2009 8:21 pm    Post subject:
Reply with quote

Hello,

You might redefine the edited field with a character (alpha) field, and move the alpha field to the output file.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us