Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us