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

Initializing Comp-3 variable


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Wed Jul 02, 2008 6:27 am
Reply with quote

I am facing a problem when i try to initialize a PS variable with Zero

I have these two fields defined in my output file.

O-XXXX-RATE +654 6 P 7
O-XXXX-FEE +660 8 P 2
When i try to initialize

O-XXXX-RATE = 0
O-XXXX-FEE = 0

I am getting invalid value in the field in the output file.
How can i initialize the numerics field?
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: Wed Jul 02, 2008 6:36 am
Reply with quote

Hello,

Quote:
I am getting invalid value in the field in the output file.
What value is in the output file?

As an experiment, please try
MOVE 0 to O-XXXX-RATE
and post back with what happens.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Wed Jul 02, 2008 6:42 am
Reply with quote

I tried MOVE 0 to O-XXXX-RATE too but
i am getting the same X'4040404040F0' in the output field
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Wed Jul 02, 2008 6:57 am
Reply with quote

Is your output defined as a file or a report?
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Wed Jul 02, 2008 7:02 am
Reply with quote

My output is defined as a File.
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: Wed Jul 02, 2008 8:07 am
Reply with quote

Hello,

Please define a new file that has a 10-byte character field and an 8 p 2 field. Initialize the character field to 10 "A"s and the packed-decimal field to zeros and write a record.

Post what is in that record.

It may be possible that the larger record is getting the zeros overlaid with spaces by some other part of the code.

If the simple 2-field test fails, we can work on that - if it works, then it will take a bit of digging into the bigger file/code.
Back to top
View user's profile Send private message
lcmontanez

New User


Joined: 19 Jun 2007
Posts: 50
Location: Chicago

PostPosted: Wed Jul 02, 2008 7:20 pm
Reply with quote

do you have a redefined field that is alpha and overlaying the position/field. Are both fields invalid or just one?

Please post your complete file definition.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Wed Jul 02, 2008 8:22 pm
Reply with quote

Hi


Yes i found the mistake it was a problem with the code. I was using an old version of the copybook and the Packed decimal field was overlaid with Spaces.

Thanks for the helping hand....
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 Jul 03, 2008 12:27 am
Reply with quote

You're welcome - thanks for posting that it is now working icon_smile.gif

d
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top