Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups 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 -> Mainframe COBOL
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 48
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
References
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1633
Location: germany

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1