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
 
Unstring a variable which having value 'bbbbbbbb9,328.32'

 
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 6:34 pm    Post subject: Unstring a variable which having value 'bbbbbbbb9,328.32'
Reply with quote

Hi,

I have the following rquirement.

I need to unstring a variable which having value 'bbbbbbbb9,328.32'

I want to unstring only when it hits the first chacter not spaces.

here b means space.

After unstring VAR1 should have 9 and VAR2 328.32.

Thanks,
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 6:54 pm    Post subject:
Reply with quote

Code:

01  WORK-STRING        PIC X(16).

01  UNSTRING-AREA.
     05  FIELD-1             PIC X(16).
     05  FIELD-2             PIC X(16).
     05  FIELD-3             PIC X(16).

UNSTRING  WORK-AREA
                     DELIMITED BY ALL SPACES OR ','
      INTO   FIELD-1
             FIELD-2
             FIELD-3
END-UNSTRING


if there are leading spaces, field-1 will be spaces, field-2 will contain 9 and field-3 will contain the rest.

if there are no leading spaces, field-1 will contain the 9, field-2 will contain the rest and field three will contain spaces.
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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm

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