View previous topic :: View next topic
|
Author |
Message |
nehrujee
New User
Joined: 25 Oct 2007 Posts: 8 Location: Kolkata
|
|
|
|
Hi,
I need to convert cobol program to PL1 program.
Can anyone help me what will be pl1 equivalent for below code snippet.
unstring Input_var delimited by ' ' or '/'
into var1, var2, var3, var4, var5
on overflow go exit-pgm
exit-pgm:
Exit
Thanks in advance.
Regards
Nehru |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Please look at String Handling Functions like SUBSTR, INDEX, etc |
|
Back to top |
|
|
donateeye Warnings : 2 New User
Joined: 01 Jun 2007 Posts: 62 Location: chennai
|
|
|
|
You cannot unstring it as in COBOL,
You got to use the builtin functions INDEX, SUBSTR and use some logic to load it into those variables. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Depending on how complex the various unstring requirements of the system, you might consider creating a common "unstring" subroutine that is called from various pl/i code that needs to unstring delimited data.
This may be preferable to including the complete code to parse out the values in each place it is needed in pl/i. The called routine might even be coded in cobol. . . Once a cobol version was working as needed, consideration could be given to converting this called routine to pl/i. |
|
Back to top |
|
|
|