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

Problem in redefining x(30) with 9(08)


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chandracdac

New User


Joined: 15 Jun 2007
Posts: 92
Location: bangalore

PostPosted: Thu Mar 24, 2011 12:14 am
Reply with quote

Hi..
I have redefined x(30) with 9(08). I will get the value in this x(30) from one of my field from table .Some times i may get the result from the table with length 7 also. Since i have redefined this with 9(08) it is adding zero at the end and my calculations are going wrong. For example if the value from my table is 12345678 then i will be able to use the same value in my calculations instead if the value from table is 1234567 then it is giving 12345670 when i use the redefined variable.. What shloud i do for rectifying this problem.

Thanks in advance...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 24, 2011 12:27 am
Reply with quote

Do you know when there's 7 and when there's 8 digits? If so, use another REDEFINES with a 7-byte variable. If not, check the 8th byte of the X(30) variable to be a space (assuming that's what it will be when the variable is only 7 bytes long) and handle the value appropriately.
Back to top
View user's profile Send private message
chandracdac

New User


Joined: 15 Jun 2007
Posts: 92
Location: bangalore

PostPosted: Fri Mar 25, 2011 12:31 pm
Reply with quote

Hi...

i don't know when i will get 7 chars and when 8 chars. that space checking was good idea.. will try that and let the people know abt that

Thanks
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top