IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Moving packed decimal field into a file using Easytrieve


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
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
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
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

Moderator Emeritus


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

PostPosted: Thu Mar 26, 2009 8:33 pm
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
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
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
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
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

Moderator Emeritus


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

PostPosted: Fri Mar 27, 2009 11:41 pm
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
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

Moderator Emeritus


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

PostPosted: Mon Mar 30, 2009 8:21 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top