Re: Need program to count delimiters



Hi:
Back in the day, I used to use both string and unstring with pointer
option to
string things together in cobol...

This was helpful in printer commands...
System Test FBM Legacy MWI DB2 Tables & Data to Oracle OWH
I think it would be difficult to write a generalized program for each
file. programs usually are data dependant, and the record layout tends
to drive your code...


D1000-STRING-THAT-THING.
512700 STRING AREA-OF-HOLD

512800 DELIMITED BY '%'

512900 INTO STRING-WORK-AREA

513000 WITH POINTER WS-STRING-POINTER.

string and unstring will be useful to handle the string or pulling
apart of the data...

sasquatch53@xxxxxxxxx wrote:
I need a utility that validates the number of delimiters in a file on
our MVS mainframe. I'm sure this is a fairly common requirement when
loading data into a data warehouse.

I was thinking that COBOL would probably be the best thing to write it
in. The latest release of COBOL we have is "Enterprise COBOL for z/OS
and OS/390 3.2". Our MVS level is "MVS LEVEL: 0510.05 z/OS V1R7".
We are using JES2.

I know a little bit of COBOL but it would take me a couple of weeks (or
more) to hack something together.

Is there anybody out there that could provide me with the basic COBOL
program that I could modify if required?

The input file is Variable Blocked (VB) but it would be nice if the
program would work for VB or Fixed Block (FB) files.

I'd like to pass in three variables:
LRECL = The logical record length of the file (would this be
required?).
DELIM = Delimiter character in HEX (in my case it's a HEX 2F).
DCOUNT = Delimiter count as an INTEGER.

There are no packed fields in these records. The entire record should
be able to be treated as a single character field.

The program should output records that have the matching number of
delimiters to one DD dataset and records that don't have the matching
number of delimiters to another DD dataset.

I looked at the COBOL manual on line and it looks like there is a
function called INSPECT that counts characters across a record/field.
Would this work?

Tim Lindsey

.



Relevant Pages

  • Re: [OT] My First C# (warning - long post)
    ... cut me some slack - show me a COBOL program with less than 15 working-storage variables! ... Yes, the Trimis probably extra now, but that was my attempt to get it to quit griping at me that I had given it a "String", when it wanted a "char". ... public string IBreturn ...
    (comp.lang.cobol)
  • Re: [OT] My First C# (warning - long post)
    ... cut me some slack - show me a COBOL program with less than 15 ... string,. ... Here's a sample from live code that covers Casting string to Char, ... public string IBreturn ...
    (comp.lang.cobol)
  • Re: J4 - presentation/discussion on "Future of the COBOL Standard"
    ... Belief trumps evidence in the land of Cobol. ... It says the size of the array DEPENDS ... Suppose you're flying a kite and someone asks the size of the tether string. ... This seldom comes up in ODO discussions. ...
    (comp.lang.cobol)
  • Re: J4 - presentation/discussion on "Future of the COBOL Standard"
    ... Belief trumps evidence in the land of Cobol. ... It says the size of the array DEPENDS ... Then he asks for the length of your tether string. ... This seldom comes up in ODO discussions. ...
    (comp.lang.cobol)
  • Re: J4 - presentation/discussion on "Future of the COBOL Standard"
    ... When ODO comes up in this forum, as it did 3 years ago and 6 months ... contrary evidence) or because it adds 'unnecessary complexity'. ... Belief trumps evidence in the land of Cobol. ... Then he asks for the length of your tether string. ...
    (comp.lang.cobol)