MicroFocus & Win XP file problems

From: Michael Russell (michael.russell_at_spamex.dsl.pipex.com)
Date: 07/22/04


Date: Thu, 22 Jul 2004 14:17:03 +0100

I'm using Net Express 3.01.14 - University edition & running Win XP Pro,
SP1.

A simple MF program to read a rather large (1.1gb) text (line seq) file & do
some simple cutting out of records seems to lose records from the output.
Well, it actually does lose them - unintentionally, of course :-)

The program is reproduced below. It never executes section 'check-status' -
there's a 'break' on that section's 1st line.

It's quite a pain trying to use a text editor on the file - Textpad & Edit
Plus both fail to load it because it's so big; Ultra Edit 32 loads it but
any editing is excrutiatingly sloooooow. Maybe there's a simple line-editor
out there?

Any thoughts?

Michael

        id division.
        program-id. Trimmer2.
        environment division.
        select lineseq-in
           assign to ws-in-file
           file status is ws-file-status
           organization is line sequential.
        select lineseq-out
           assign to ws-out-file
           file status is ws-file-status
           organization is line sequential.
        data division.
        file section.
        fd lineseq-in
        record contains 200 characters.
        01 lineseq-in-rec pic x(200).
        fd lineseq-out
        record contains 200 characters.
        01 lineseq-out-rec pic x(200).
       working-storage section.
        01 ws-in-file pic x(45) value
                       'f:\Small-jun01-jul06.sql'.
        01 ws-out-file pic x(45) value
                       'f:\Jun20.sql'.
        01 ws-file-status.
           05 status-key-1 pic x.
           05 status-key-2 pic x.
           05 binary-status redefines status-key-2 pic 99 comp-x.
       01 ws-recs-in pic 9(9).
       01 ws-recs-out pic 9(9).
       01 ws-recs-includeed pic 9(9).
       01 ws-start-include pic 9(9).
       01 ws-end-include pic 9(9).
       01 ws-recs-to-include pic 9(9).
       01 ws-yorn pic x.
       procedure division.
       a-control section.
           move 0 to ws-recs-in, ws-recs-out, ws-recs-includeed
                     ws-start-include, ws-end-include
           perform until exit
              display 'Start include:'
              accept ws-start-include
              display 'End include (inclusive):'
              accept ws-end-include
              if ws-start-include > 0 and
                 ws-start-include < ws-end-include
                 compute ws-recs-to-include =
                         ws-end-include - ws-start-include + 1
                 display 'include ', ws-recs-to-include, '?'
                 accept ws-yorn
                 if ws-yorn <> 'Y' and
                    ws-yorn <> 'y'
                    stop run
                 end-if
                 exit perform
              else
                 display 'Range error!'
              end-if
           end-perform
           perform z-opens.
           if status-key-1 <> '0'
              perform check-status
              stop run
           end-if.
           perform b-copy.
           close lineseq-in, lineseq-out
           stop run.
       b-copy section.
           perform until exit
              read lineseq-in
                at end
                   exit perform
              end-read
              if status-key-1 <> '0'
                 perform check-status
                 stop run
              end-if
              add 1 to ws-recs-in
              if ws-recs-in = ws-start-include
                 move '-- start include at'
                   to lineseq-out-rec
                 move ws-start-include to lineseq-out-rec(21:10)
                 move 'until (inclusive):' to lineseq-out-rec(32:50)
                 move ws-end-include to lineseq-out-rec(51:10)
                 write lineseq-out-rec
                 if status-key-1 <> '0'
                    perform check-status
                    stop run
                 end-if
                 exit perform cycle
              end-if
              if ws-recs-in < ws-start-include
                 exit perform cycle
              end-if
              if ws-recs-in > ws-end-include
                 exit perform
              end-if
              if ws-recs-in = (ws-end-include + 1)
                 move '-- end include at'
                   to lineseq-out-rec
                 move ws-end-include to lineseq-out-rec(21:10)
                 write lineseq-out-rec
                 if status-key-1 <> '0'
                    perform check-status
                    stop run
                 end-if
                 exit perform cycle
              end-if
              write lineseq-out-rec from lineseq-in-rec
              if status-key-1 <> '0'
                 perform check-status
                 stop run
              end-if

              add 1 to ws-recs-out
              if ws-recs-in(5:5) = '00000'
                 display 'Read=' ws-recs-in
                         ' Written=', ws-recs-out
              end-if
           end-perform.
       z-opens section.
           open input lineseq-in.
           if status-key-1 <> '0'
              perform check-status
              stop run
           end-if.
           open output lineseq-out.
           if status-key-1 <> '0'
              perform check-status
              stop run
           end-if.

        check-status section.
           display 'oops at:' ws-recs-in, ', in'
           display 'recs out:' ws-recs-out
           evaluate status-key-1
              when "0" next sentence
              when "1" display "end of file reached"
                 perform check-eof-status
              when "2" display "invalid key"
                 perform check-inv-key-status
              when "3" display "permanent error"
                 perform check-perm-err-status
              when "4" display "logic error"
              when "9" display "run-time-system error"
                 perform check-mf-error-message
           end-evaluate.

        check-eof-status section.
           if status-key-2 = "0"
              display "no next logical record"
           end-if.

        check-inv-key-status section.
           evaluate status-key-2
              when "2" display "attempt to write dup key"
              when "3" display "no record found"
           end-evaluate.

        check-perm-err-status section.
           if status-key-2 = "5"
              display "file not found"
           end-if.

        check-mf-error-message section.
           evaluate binary-status
              when 002 display "file not open"
              when 007 display "disk space exhausted"
              when 013 display "file not found"
              when 024 display "disk error "
              when 065 display "file locked "
              when 068 display "record locked "
              when 039 display "record inconsistent"
              when 146 display "no current record "
              when 180 display "file malformed "
              when 208 display "network error "
              when 213 display "too many locks "
              when other display "not error status "
              display binary-status
           end-evaluate.



Relevant Pages

  • Re: Hard Disk Failing?
    ... then niether operating system installation will load. ... Associate Expert - WindowsXP Expert Zone ... >I mounted a 2nd 120GB hard Disk about a year ago and loaded XP Pro on ... > Visit Topic URL to contact author (reg. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: ZoneAlarm Plus Problems - New Release Of ZA
    ... I have a copy of ZoneAlarm Pro sitting here. ... system services which load during startup. ...
    (comp.security.firewalls)
  • Re: ZoneAlarm Plus Problems - New Release Of ZA
    ... I have a copy of ZoneAlarm Pro sitting here. ... system services which load during startup. ...
    (comp.security.firewalls)
  • Re: Dead primary HD - Install new HD with OEM XP pro clean not upgrad
    ... > bad drive F:120MB WD drive is outside normal specs - still runs ... > pro w/SP2 trying to add to new HD and run future 80GB as ghost drive. ... > do anything to its data during my new load on the new HD? ... Set boot order to boot from CD before hard drive. ...
    (microsoft.public.windowsxp.newusers)
  • Re: Dead primary HD - Install new HD with OEM XP pro clean not upgrad
    ... > bad drive F:120MB WD drive is outside normal specs - still runs though. ... Used WD HD disk to install and partition new drive. ... loaded XP Pro disk and rebooted. ... > Is this thing going to load or do I have issues? ...
    (microsoft.public.windowsxp.newusers)