Re: Trying to use STRING



In article <1173881236.224187.243780@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
razor <iruddock@xxxxxxxxxxxxxxxx> wrote:
Sorry, should have added I am using MF Netexpress 3.1.

Why do these request for help result in people trying to 'outcode'
each other?

I'm not sure if that is what is happening, Mr Ruddock, or whether it is
'this is what comes to my mind'; you asked for help with code and coders
offered help... and code.

[snip]

I don't like having to rely on two (or more) spaces as this is a fudge
and will come back to haunt a future COBOL trainee given his first
debugging task.

It is best, I've found, to make as few assumptions about data as possible;
'it will be terminated by two spaces and never, *ever*, contain two
embedded spaces' is more reliant on purity than I like to be. As my first
programming instructor asked the class:

'What is the definition of a 'computer user'?

(pause for responses, each met with a curt 'No')

'A 'computer user' is someone who, when prompted to supply a 'Y' or 'N'
response, will key in the numeral '8'. Write *all* of your online
applications with this in mind and your users will love you.'

Life may not be that simple, no... but I've found it a good rule to
remember.


I had already thought about reading backwards through each string and
using 'Reference modification' to effectively trim each field.

Great minds running in similar and small circles, perhaps.


Thanks DD for your help. Sorry, but your assumptions about 77's was
incorrect. I have never used mainframe so never had to worry about
word alignment and now just don't care whether I use 77 or 01 levels.
Yes, I'm 'out there crazy' aren't I.

Not in the least... I heard hoofbeats and I concluded 'horses'; this week
it was zebras... I'll survive the stampede, somehow.


So my solution will have to be as I had originally thought, but very
inelegant.

77 WS-NAME PIC X(30).
77 WS-ADD1 PIC X(30).
77 WS-BALANCE PIC ZZZZZ9.99.
77 WS-STRING PIC X(60).
77 WS-STRING-LENGTH PIC 99.
77 WS-NAME-LENGTH PIC 99.
77 WS-ADD1-LENGTH PIC 99.


MOVE WS-NAME TO WS-STRING PERFORM GET-LENGTH-OF-STRING MOVE WS-STRING-
LENGTH TO WS-NAME-LENGTH.

Once it is cleaned up I'd say the mechanism (use of common area and code)
is one I've seen before; as a matter of style I'd prefer doing it all 'in
place' as my given example indicated.

If you have access to someone who can be used as the 'future COBOL
trainee' you mention being concerned about - a more common use, in my
experience, is 'a two-year programmer' - you might want to present both
styles and see what the response is.

[snip]

Thanks to all, as its my first request for help, standby for
more....:-)

For a first request it seemed remarkably well-formed, with examples of
data, what you want and (most importantly, to some) what you've tried
already.

DD

.



Relevant Pages

  • Re: How can I save to a file to the PDA?
    ... but just out of mind here is how I will do in pseudo code ... Request = WebRequest.Create ... Response = Request.GetResponse ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... allow the page to tell ASP.Net "don't send a response yet until I tell ... this request is "leaked" and will never ... It is when the callback executes with both the async function call ... The thread executing code literally calls into Function1, execute code, ...
    (microsoft.public.inetserver.iis)
  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... >> The way I understand async programming is if u need to do other ... >> request to webservice nothing more can be done until the result ... > The thread executing code literally calls into Function1, ... > the act of sending back the response using data that has been ...
    (microsoft.public.inetserver.iis)
  • ADFS & Sharepoint 2007 Errors
    ... Request or Response. ... claim Group = adfstest readers for user sid ... Sign In Response Dump ...
    (microsoft.public.windows.server.active_directory)
  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... Web Page makes HTTP request to web service ... Web Page waits for HTTP response to return ... Since ASP.Net depends on the worker threads to "do work", ...
    (microsoft.public.inetserver.iis)