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
 

 

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: 6966
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 Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am


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