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

Manipulating numbers and comma. (Question)


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

New User


Joined: 18 Aug 2006
Posts: 5

PostPosted: Mon Sep 25, 2006 6:56 pm
Reply with quote

Hi Everyone.
How can i manipulate comma with numbers? i need a logical response.

For example:

I have a field with 8 bytes 9(08) and when someone enters some number
(like 00200000) i need my program changes to XXX,XXXXX

i need to create a table and check number by number and count the decimal ? if someone have a example and can post it to me, i will be happy!

Thx for all.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Sep 25, 2006 10:07 pm
Reply with quote

Your question seems straight foreword.

Code:

    01  VAR1 PIC 9(8) VALUE 02000000.
    01  VAR2 PIC 9(3),9(5).

    MOVE VAR1 to VAR2.


Result will be 020,00000

Dave
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Mon Sep 25, 2006 10:13 pm
Reply with quote

Use ZZZ,ZZZZ in the picture clase and more variable to this
For more inforamtion see editable charaters in COBOL
Back to top
View user's profile Send private message
Marcos_Rodrigues

New User


Joined: 18 Aug 2006
Posts: 5

PostPosted: Mon Sep 25, 2006 10:23 pm
Reply with quote

when i do that way (move var1 to var2.) my cobol program is moving ZEROS to var2... and i move 020000 to var1...
did u know why that?
Back to top
View user's profile Send private message
Marcos_Rodrigues

New User


Joined: 18 Aug 2006
Posts: 5

PostPosted: Mon Sep 25, 2006 10:31 pm
Reply with quote

Thx Kgmuraj.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Sep 26, 2006 2:56 am
Reply with quote

Marcos_Rodrigues wrote:
when i do that way (move var1 to var2.) my cobol program is moving ZEROS to var2... and i move 020000 to var1...
did u know why that?


Can you please post the working storage / program sections that execute the code you are having the question about?

Thanks,

Dave
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
Search our Forums:

Back to Top