Re: Productivity
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Dec 2006 12:34:44 +1300
"Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> wrote in message
news:4vimr5F1cedo7U1@xxxxxxxxxxxxxxxxxxxxx
Pete Dashwood<dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> 12/27/06 5:59 PM >>>
dismissing
"Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> wrote in message
news:4vfl66F1as7a4U1@xxxxxxxxxxxxxxxxxxxxx
Pete Dashwood<dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> 12/27/06 3:40 AM >>><snipped>
"Frank Swarbrick" <infocat@xxxxxxxxxxxxx> wrote in message
I guess I'm sensitive about powerful constructs being banned on sites
(having worked in many places where they are) simply because people don't
take the trouble to understand how they work. When teachers start
them too ... well, I was hoping to get you to look again.
I was only joking about that. If I ever came upon a situation where it
appears this construct would be useful I would have no problem using it.
I
just don't recall ever coming upon such a thing. Or, if I did, I probably
didn't realize it and thus did something else. :-)
Fair enough. Thanks for that.
I am certainly *not* against using all of the power that COBOL provides.
I
only recently used DECLARATIVES recently to handle file I/O errors. It's
actually quite nice, not having to check the status after each I/O.
Should
be a bit more powerful to be *really* useful, but I'd be happy to see
others
understand and use it. My manager at first was against my use of this,
but
I convinced him by pointing out that it's an "implicit perform" rather
than
an "implicit goto".
Yes, DECLARATIVES can be very useful. In the old days, before disks, we used
them all the time to handle tape errors... :-)
I've also recently been using UNSTRING, which I hadn't made a lot of use
of
in the past. Below is something I was working on the other day. I had
hoped to be able to get it in to a single "UNSTRING", but I ended up with
two and I'm fairly happy with it. Essentially, it parses some input where
fields are delimited by '¦' (MSG-FIELD-DELIMITER), and for each field
there
can be both a parm name and a parm value delimited by '='
Do you mean it looks like this: |name=value=| or |name=value| ?
(MSG-FIELD-SEPARATOR), or just a parm name (no '='). Each perform of
300-PARSE-INPUT-DATA should result in the parsing of one field, putting
the
parm name into INPUT-STRING-ID and the parm value (if present) into
INPUT-STRING-PARM. If the field is a "null" field (essentially '¦¦') then
the flag END-OF-REQUEST should be set.
If you can clarify the use of = as requested above, I believe I can do this
with a single UNSTRING.
Having said that, what you have posted is pretty good, especially for an
early attempt :-)
I think I would unstring ALL of the parameters into a name/value array
during initialization, rather than go back to the arguments during
processing, but that is just me...
300-PARSE-INPUT-DATA.
MOVE LOW-VALUES TO INPUT-STRING-ID
INPUT-STRING-PARM
STRING-ID-DELIM
STRING-PARM-DELIM
MOVE ZEROES TO STRING-ID-LEN
STRING-PARM-LEN
IF INPUT-DATA-POS > INPUT-DATA-LENGTH
SET END-OF-REQUESTS TO TRUE
ELSE
UNSTRING INPUT-DATA
DELIMITED BY MSG-FIELD-DELIMITER
OR MSG-FIELD-SEPARATOR
INTO INPUT-STRING-ID
DELIMITER IN STRING-ID-DELIM
COUNT IN STRING-ID-LEN
POINTER INPUT-DATA-POS
END-UNSTRING
IF STRING-ID-DELIM = MSG-FIELD-SEPARATOR
UNSTRING INPUT-DATA
DELIMITED BY MSG-FIELD-DELIMITER
INTO INPUT-STRING-PARM
DELIMITER IN STRING-PARM-DELIM
COUNT IN STRING-PARM-LEN
POINTER INPUT-DATA-POS
END-UNSTRING
END-IF
IF STRING-ID-LEN = ZERO
SET END-OF-REQUEST TO TRUE
END-IF
I'm guessing there is no way to make this a single UNSTRING, but if anyone
can do it I'd love to see it! :-)
Post some example parameter strings so we can be sure we are on the same
wavelength and I'll post what my solution would be. There are many ways to
do this; I'm not saying mine is the best, but it would use a single
UNSTRING.
<snip>
I sometimes (often?) wish I worked in a job where I could take advantage
of
such tools, rather than just fooling around with them at home. Our
Windows
applications team is now using Visual C# and sometimes I am jealous!
(They
had been using Borland Delphi previously, but were having a hard time
finding Delphi developers.)
That is very interesting to me as I'm getting into C# at the moment. I was
wondering if any Corporates were looking at it... Statistics say they are,
but it is nice to have this confirmed by some first hand reports.
The questions are not relevant if VS2005 is used, as the DotNET framework
handles them.
When do we get .NET for the mainframe? :-)
Er... I think it's called LE :-)
That is up to you, of course. I, for one, value your contributions, even
if
it sometimes appears that I don't. :-)
Thanks :-)
Pete.
.
- Follow-Ups:
- Re: Productivity
- From: Frank Swarbrick
- Re: Productivity
- References:
- Productivity
- From: Pete Dashwood
- Re: Productivity
- From: HeyBub
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Robert Jones
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Frank Swarbrick
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Frank Swarbrick
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Frank Swarbrick
- Productivity
- Prev by Date: Re: Productivity
- Next by Date: Re: Micro Focus COBOL Visual C++ linking
- Previous by thread: Re: Productivity
- Next by thread: Re: Productivity
- Index(es):