Home > Archive > Cobol > February 2005 > does MF Cobol have any string functions?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
does MF Cobol have any string functions?
|
|
| Fred Exley 2005-02-26, 3:55 pm |
| I'm looking for a substring function, or something similar, and about all I can
find is 'unstring'. Apparently even the 'EXAMINE' statement is no longer
supported.
There must be a need for a string library (i.e., length, substring, trim,
concatenate, etc.) in many business application, so it seems unbelievable these
are missing in Cobol. Or am I missing something here? thanks
-Fred
| |
| Michael Mattias 2005-02-26, 3:55 pm |
| "Fred Exley" <fexly221@msn.com> wrote in message
news:1121b5vcagem504@corp.supernews.com...
> I'm looking for a substring function, or something similar, and about all
I can
> find is 'unstring'. Apparently even the 'EXAMINE' statement is no longer
> supported.
>
> There must be a need for a string library (i.e., length, substring, trim,
> concatenate, etc.) in many business application, so it seems unbelievable
these
> are missing in Cobol. Or am I missing something here? thanks
What you are missing is called "reference modification"
MOVE "hello world" to source-string
MOVE Source_-tring ( 6:5) to dest-string
DISPLAY dest-string << displays 'world'
MCM
| |
| Richard 2005-02-26, 3:55 pm |
| > Apparently even the 'EXAMINE' statement is no longer supported.
Replaced by the much more powerful INSPECT.
> There must be a need for a string library (i.e., length, substring,
trim, concatenate, etc.)
length -> INSPECT
substring -> reference modification
concatenate -> STRING
| |
| Fred Exley 2005-02-26, 3:55 pm |
|
"Richard" <riplin@Azonic.co.nz> wrote in message
news:1109439952.635595.292720@z14g2000cwz.googlegroups.com...
>
> Replaced by the much more powerful INSPECT.
>
> trim, concatenate, etc.)
>
> length -> INSPECT
> substring -> reference modification
> concatenate -> STRING
Thanks much, Richard and Michael. Them thingees ought to do it! -Fred
| |
| William M. Klein 2005-02-26, 3:55 pm |
| FYI,
Although the other answers have provided "tools" to do what you (probably)
want, I just thought that I should add that Micro Focus *does* still support
"EXAMINE" - if the OSVS directive is turned on.
(If you mean "mainframe" by "MF" - then it probably is NOT supported - at least
none of the current mainframe compilers that I know of still support EXAMINE)
--
Bill Klein
wmklein <at> ix.netcom.com
"Fred Exley" <fexly221@msn.com> wrote in message
news:1121b5vcagem504@corp.supernews.com...
> I'm looking for a substring function, or something similar, and about all I
> can find is 'unstring'. Apparently even the 'EXAMINE' statement is no longer
> supported.
>
> There must be a need for a string library (i.e., length, substring, trim,
> concatenate, etc.) in many business application, so it seems unbelievable
> these are missing in Cobol. Or am I missing something here? thanks
>
> -Fred
>
| |
| James J. Gavan 2005-02-26, 3:55 pm |
| Fred Exley wrote:
> I'm looking for a substring function, or something similar, and about all I can
> find is 'unstring'. Apparently even the 'EXAMINE' statement is no longer
> supported.
>
> There must be a need for a string library (i.e., length, substring, trim,
> concatenate, etc.) in many business application, so it seems unbelievable these
> are missing in Cobol. Or am I missing something here? thanks
>
> -Fred
>
>
One of those M/F lurkers reading this ? Going to the Home Page I always
have trouble trying to locate this. Could the Home Page be amended to
get 'newbies' direct into this Agreement Page and then the Signing Up
page for Answer Exchange.
Fred,
Assumption is you are using Net Express or one of the other 'Expresses' ???
Over and above SupportLine (if you are paid up for technical support)
there is the Answer Exchange which is interactive between M/F folks and
developers. Here's a link - which hopefully when you hit 'I agree' will
let you sign up - Free.
http://www.cobolportal.com/microfoc...m/agreement.asp
You get back almost immediate confirmation then you can look at the N/E
Forum, post or read messages. When you get in, there are also search
facilities (1) Current messages, (2) Search an old archive - doesn't
accept new messages, and (3) An M/F Knowledge Base. Latter is not yet
indexed, (When's that going to be Simon T. ? :-) ), so you have to get
lucky on the search word(s) you use.
In response to your query, care to spell out some of the things you want
to do ? There are ways of handling them all, using combinations :-
- some of the intrinsic functions relating to text/strings
- Reference Modification ?
- OO classes handling text - which can be invoked from Procedural programs
On the latter take a look at the following which I have as a shortcut on
my desktop :-
"C:\Program Files\MERANT\Net Express\Base\BIN\MFNXCL31.CHM" - that is
for Version 3.1
Bring up the hierarchy in the right pane and look at Array,
CharacterArray etc.
Some specifics on what you want to do - then I could make further
suggestions.
Jimmy, Calgary AB
| |
| Fred Exley 2005-02-26, 3:55 pm |
|
"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:Zh3Ud.3188014$B07.504121@news.easynews.com...
> FYI,
> Although the other answers have provided "tools" to do what you (probably)
> want, I just thought that I should add that Micro Focus *does* still support
> "EXAMINE" - if the OSVS directive is turned on.
>
> (If you mean "mainframe" by "MF" - then it probably is NOT supported - at
> least none of the current mainframe compilers that I know of still support
> EXAMINE)
Thanks for that tid-bit too, William. I don't really care to use EXAMINE, just
trying to get the job done, hopefully in the most current and elegant way. It's
things like you mentioned e.g., the OSVS directive, that make this group so
worthwhile -I could have spent days screwing around and never come across that
nor reference modification nor INSPECT. BTW, as a result of Michaels response I
found this interesting site:
http://www.csis.ul.ie/COBOL/Course/RefMod.htm#part1
-Fred
| |
| JerryMouse 2005-02-26, 8:55 pm |
| Michael Mattias wrote:
> "Fred Exley" <fexly221@msn.com> wrote in message
> news:1121b5vcagem504@corp.supernews.com...
>
> What you are missing is called "reference modification"
>
> MOVE "hello world" to source-string
> MOVE Source_-tring ( 6:5) to dest-string
> DISPLAY dest-string << displays 'world'
If this sort of thing happens often in your application, it's handy to have
a subprogram. You'll have to pass it:
1. The original string
2. Length of original string
3. String to insert
4. Length of insert string
5. Location to start insertion.
And deal with potential overflow.
One trick is to perform the operation without an intermediate work area,
that is, insert-in-place. We've got one copied from I-forget-where if anyone
wants it, I'll be glad to post the code here (it's about 20 lines).
| |
| Fred Exley 2005-02-26, 8:55 pm |
|
"James J. Gavan" <jgavandeletethis@shaw.ca> wrote in message
news:pL3Ud.514200$Xk.244507@pd7tw3no...
> Fred Exley wrote:
> One of those M/F lurkers reading this ? Going to the Home Page I always have
> trouble trying to locate this. Could the Home Page be amended to get 'newbies'
> direct into this Agreement Page and then the Signing Up page for Answer
> Exchange.
>
>
> Fred,
>
> Assumption is you are using Net Express or one of the other 'Expresses' ???
>
> Over and above SupportLine (if you are paid up for technical support) there is
> the Answer Exchange which is interactive between M/F folks and developers.
> Here's a link - which hopefully when you hit 'I agree' will let you sign up -
> Free.
>
> http://www.cobolportal.com/microfoc...m/agreement.asp
>
> You get back almost immediate confirmation then you can look at the N/E Forum,
> post or read messages. When you get in, there are also search facilities (1)
> Current messages, (2) Search an old archive - doesn't accept new messages, and
> (3) An M/F Knowledge Base. Latter is not yet indexed, (When's that going to be
> Simon T. ? :-) ), so you have to get lucky on the search word(s) you use.
>
> In response to your query, care to spell out some of the things you want to do
> ? There are ways of handling them all, using combinations :-
>
> - some of the intrinsic functions relating to text/strings
> - Reference Modification ?
> - OO classes handling text - which can be invoked from Procedural programs
>
> On the latter take a look at the following which I have as a shortcut on my
> desktop :-
>
> "C:\Program Files\MERANT\Net Express\Base\BIN\MFNXCL31.CHM" - that is for
> Version 3.1
>
> Bring up the hierarchy in the right pane and look at Array, CharacterArray
> etc.
>
> Some specifics on what you want to do - then I could make further suggestions.
>
> Jimmy, Calgary AB
Thank you too sir, and I did just that -signed up on the Microfocus forum. The
rest of your post totally lost me (not a difficult task), but anyway, my general
assignment is to split existing Cobol apps into a back-end batch routine to do
file accesses/data manipulation, and a java front-end to do all the presentation
tasks. This particular issue came up because one program I'm working on has
some home-spun attempt at string parsing that doesn't work right. Aside from
that immediate need, what I'm really always looking for are things I never new
existed. This morning I hit the jackpot :)
Thanks again. -Fred
|
|
|
|
|