MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To split(unstring) a string.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
desporter
Beginner


Joined: 17 Oct 2006
Posts: 2
Topics: 1

PostPosted: Tue Oct 17, 2006 6:26 am    Post subject: To split(unstring) a string. Reply with quote

Please help me to indentify a PL/I string function to unstring STR01 into STR02,STR03,STR04 with comma as delimiter.
------------------------------
DCL STR01 CHAR(5) INIT (A,B,C);
DCL STR02 CHAR(1);
DCL STR03 CHAR(1);
DCL STR04 CHAR(1);
-----------------------------
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Tue Oct 17, 2006 6:36 am    Post subject: Reply with quote

desporter,

Your declaration itself is wrong.Try this code:
Code:

      DCL STR01 CHAR(5) INIT ('A,B,C');                                 
      DCL STR02 CHAR(1) INIT (' ');                                     
      DCL STR03 CHAR(1) INIT (' ');                                     
      DCL STR04 CHAR(1) INIT (' ');                                     
      STR02 = SUBSTR(STR01,1,1);                                       
      STR03 = SUBSTR(STR01,3,1);                                       
      STR04 = SUBSTR(STR01,5,1);                                       
      PUT SKIP LIST ('STR02 IS :',STR02);                               
      PUT SKIP LIST ('STR03 IS :',STR03);                               
      PUT SKIP LIST ('STR04 IS :',STR04);                               

OUTPUT
Code:

STR02 IS :              A
STR03 IS :              B
STR04 IS :              C

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
desporter
Beginner


Joined: 17 Oct 2006
Posts: 2
Topics: 1

PostPosted: Tue Oct 17, 2006 7:13 am    Post subject: To split(unstring) a string. Reply with quote

Hi:

Thanks for your reply.
I am looking for something like UNSTRING verb in COBOL.
I want to split string into different variable by a delimiter.
_________________
- Senthil Kumar.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group