View previous topic :: View next topic
|
Author |
Message |
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
IF I = 1
DISPLAY 'Total ABC Calls : ' ABC-CE-TRGT(J, I)
END-IF
In this two dimensional clause, I have declared ABC-CE-TRGT as PIC 9(18). Now Whlile displaying these values I wanted to supress the leading zeros.
Can any one help me on How to display the value after supressing leading zeros?
Thanks!
Rat... |
|
Back to top |
|
|
Aji
New User
Joined: 03 Feb 2006 Posts: 53 Location: Mumbai
|
|
|
|
Hi
Declare
01 ws-edit pic z(17)9. in working storage section.
move ABC-CE-TRGT(J, I) to ws-edit.
ws-edit contains zero suppressed value.
Regards
Aji Cherian |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Aji, I tried with your code, and its working fine. Thank you very much for your help. Again one more query, if I wanted to display this value as Left Justified, how to code it? I have see in the Reference material that we can't use Justify clauses for Numerics or Numeric Edited Values. Is there any other way?
Thanks!
Rat...
Aji wrote: |
Hi
Declare
01 ws-edit pic z(17)9. in working storage section.
move ABC-CE-TRGT(J, I) to ws-edit.
ws-edit contains zero suppressed value.
Regards
Aji Cherian |
|
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Declare 01 ws-edit pic z(17)9 left.
move ABC-CE-TRGT(J, I) to ws-edit.
ws-edit contains zero suppressed value & left aligned |
|
Back to top |
|
|
Aji
New User
Joined: 03 Feb 2006 Posts: 53 Location: Mumbai
|
|
|
|
Hi
You can use the following method also, if anyother simple method is not available.
working-storage section.
01 a pic 9(18) value 0.
01 b redefines a pic x(18).
01 l pic 99 value 1.
01 ws-new pic x(18).
01 ws-temp pic x value "0".
01 ws-x pic 99.
procedure division.
p1.
accept a.
perform p2 varying l from 1 by 1 until ws-temp not = "0".
compute ws-x = 18 - l + 2.
subtract 1 from l.
move b(l:ws-x) to ws-new.
display ws-new.
stop run.
p2.
move b(l:1) to ws-temp.
Regards
Aji Cherian |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Aji, once again thank you very much. I tried with this logic, and its working fine.
Also I need one suggestion from you.
Can you give me some tips to become an expert in Cobol. B'cos Recently I strated my career in Cobol. and also in our company we are not using Cobol much. Just now only I started doing Analysis and adding some logic to my program. Also I am too much poor in Table Handling concepts. Though I studied hundreds of times, I couldn't be proficient in this concept.
Thanks!
RAt... |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Aji, once again thank you very much. I tried with this logic, and its working fine.
By seeing these things you are looking like an expert in Cobol.
If you don't mind I need some suggestion from you...
Please give me some tips to become an expert in Cobol. B'cos Recently I strated my career in Cobol. and also in our company we are not using Cobol much. Just now only I started doing Analysis and adding some logic to my program. Also I am too much poor in Table Handling concepts. Though I studied hundreds of times, I couldn't be proficient in this concept.
Thanks!
RAt... |
|
Back to top |
|
|
Aji
New User
Joined: 03 Feb 2006 Posts: 53 Location: Mumbai
|
|
|
|
Hi
Refer some good cobol books.Understand the concepts.Then practice and practice and practice...
If you have any difficulty seek expert opinion.
This will make you perfect.
Table handling is not a difficult issue in cobol, you start with
single dimensional table, then multi dimensional.
Write a two dimensional array to accept a matrix, display it etc.
Then accept two matrices add it, display it etc...
Again, practice will make you perfect.
Regards
Aji Cherian |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Aji, Thank you very much for you suggestion. Here after I'll follow in this way. As of now I didn't practice, I always referring the materials. Here onwards I'll start doing practice also.
Thanks!
RAt... |
|
Back to top |
|
|
|