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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Problem in redefining x(30) with 9(08)
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: 7999
Location: Bellevue, IA

PostPosted: Thu Mar 24, 2011 12:27 am    Post subject:
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    Post subject: Reply to: Problem in redefining x(30) with 9(08)
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm


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