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
 

 

How i get the result by using with the UNSTRING

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
prashanth1

New User


Joined: 27 Sep 2006
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 04, 2006 10:23 am    Post subject: How i get the result by using with the UNSTRING
Reply with quote

Hello All,

I have one doubt on UNSTRING.

Ex:

77 A PIC X(10) VALUE '29/10/2006'

01 B .
02 B1 PIC X(2)
02 B2 PIC X(2)
02 B3 PIC X(4)

result should be like this B1= 29
B2=10
B3=2006

My doubt is , How i get the above result by using with the UNSTRING


Thanx in adv
Back to top
View user's profile Send private message

hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Wed Oct 04, 2006 10:46 am    Post subject: Re: unstring
Reply with quote

Hi

I guess u r asking abt its Syntax.U could have easily found it anywhere in
this Forum or any tutorial.

anyways here is the syntax

UNSTRING
UNSTRING command is used to split one string to many strings.
Syntax:
UNSTRING identifier-1
[DELIMITED BY (ALL/) identifier2/literal1 [,OR (ALL/) (identifier-3/literal-2),..]]
INTO identifier-4 [, DELIMITER IN identifier-5, COUNT IN identifier-6]
[, identifier-7 [,DELIMITER IN identifier-8, COUNT IN identifier-9]

01 WS-DATA PIC X(12) VALUE ?10/200/300/1?.
UNSTRING WS-DATA DELIMITED BY ?/?
INTO WS-FLD1 DELIMITER IN WS-D1 COUNT IN WS-C1
WS-FLD2 DELIMITER IN WS-D2 COUNT IN WS-C2
WS-FLD3 DELIMITER IN WS-D3 COUNT IN WS-C3
END-UNSTRING.
Result:
WS-FLD1 = 10 WS-FLD2 =200 WS-FLD3=300
WS-C1 = 2 WS-C2=3 WS-C3=3 WS-D1 = ?/? WS-D2=?/? WS-D3 ?/?
ON OVERFLOW can be coded with STRING and UNSTRING. If there is STRING truncation then the imperative statements followed ON OVERFLOW will be executed.

This is al abt UNSTRING
Thanks,
-Kapil
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts scheduling between OPC and TWS give u... nsbl IBM Tools 1 Sun Mar 12, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
This topic is locked: you cannot edit posts or make replies. How to run and see the result of DFH$... lind sh CICS 2 Wed Jul 27, 2016 7:04 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm


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