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
 

 

Manipulating numbers and comma. (Question)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Manipulating numbers and comma. (Question)
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    Post subject: Re: Manipulating numbers and comma. (Question)
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    Post subject: Re: Manipulating numbers and comma. (Question)
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    Post subject:
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    Post subject:
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    Post subject: Re: Manipulating numbers and comma. (Question)
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    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 QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm


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