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

Unstring a variable which having value 'bbbbbbbb9,328.32'


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Tue Jul 15, 2008 6:54 pm
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 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 Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top