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
 

 

Chacter handling in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Tue Jul 15, 2008 3:01 pm    Post subject: Chacter handling in COBOL
Reply with quote

Hi ,

I have the following pic clause

05 S-SALES-AMOUNT PIC S9(13)V99 COMP-3.
05 RPT-GROSS-S PIC Z,ZZZ,ZZZ,ZZZ,ZZ9.99-.

Requirement is to move RPT-GROSS-S to S-SALES-AMOUNT.

I tried with inspect and string with no success.

Please suggest.

Anand
Back to top
View user's profile Send private message

ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Jul 15, 2008 3:22 pm    Post subject:
Reply with quote

Moving a numeric edited to comp-3 might give a wrong result ...

if i move 100000 to RPT-GROSS it will be 100,000.00 and moving RPT-GROSS to SALES-AMOUNT will give 000000010000000 .....

Wht is the requirement ? and y was string and inspect used ??
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Tue Jul 15, 2008 4:27 pm    Post subject:
Reply with quote

I used inspect to replace all spaces with zeros.
then unstring to split the variable delimited by spaces.
String to concatenate all variables.

it is working fine now . I want to know is there any function to handle this.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jul 15, 2008 4:29 pm    Post subject:
Reply with quote

redefine RPT-GROSS-S as PIC x and then use FUNCTION NUMVAL
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jul 15, 2008 6:39 pm    Post subject:
Reply with quote

I think this support started w/later releases of COBOLII.

Try "MOVE RPT-GROSS-S TO S-SALES-AMOUNT".
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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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