HP3000-L Archives

February 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Black, Cory" <[log in to unmask]>
Reply To:
Black, Cory
Date:
Thu, 15 Feb 2001 16:10:51 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (59 lines)
We are having problems with an old program, so rather than try and change
the program I'm trying to filter the input file.  Using STR and a few levels
of IF statements I'm able to filter out the "garbage" and keep only what we
need.  The problem is that ECHO is writing 2 lines, the data followed by a
blank line.  The relevant code follows.

TIA.

Cory Black 
First Penn-Pacific Life
847-466-8558

   44     !build IT2;rec=-79,,f,ascii;temp;disc=10000,8,1
   45     !file IT2=IT2,oldtemp
   46     !build REJECTF;rec=-79,,f,ascii;temp;disc=10000,8,1
   47     !file REJECTF=REJECTF,oldtemp
   48     !FILE IT,NEW;SAVE;REC=-79,255,F,ASCII;DISC=10000,8,1;MSG
   49     !LISTF @[log in to unmask]@.lnp,2;*IT
   51     !setvar first_time,true
   52     !setvar rej_first_time,true
   53     !setvar counter (finfo('IT',"eof"))
   54     !SHOWVAR COUNTER
   55     !while counter > 0
   56     !  input rec < IT
   57     !  setvar strvar1 (str('!rec',21,2))
   58     !  setvar strvar2 (str('!rec',26,2))
   59     !  showvar strvar1
   60     !  showvar strvar2
   61     !  if (numeric ('!strvar1'))
   63     !    if !strvar1 < 81
   65     !      if strvar2 = 'FA'
   67     !        echo !rec >> *IT2
   67.1   !      else
   67.2   !        if rej_first_time
   67.3   !          setvar rej_first_time,false
   67.4   !          echo !rec > *REJECTF
   67.5   !        else
   67.6   !          echo !rec >> *REJECTF
   67.7   !        endif
   68     !      endif
   68.1   !    else
   68.2   !      if rej_first_time
   68.3   !        setvar rej_first_time,false
   68.4   !        echo !rec > *REJECTF
   68.5   !      else
   68.6   !        echo !rec >> *REJECTF
   68.7   !      endif
   69     !    endif
   70     !  else
   71     !    if first_time
   72     !      setvar first_time,false
   73     !      echo !rec > *IT2
   74     !    else
   75     !      echo !rec >> *IT2
   76     !    endif
   77     !  endif
   78     !  setvar counter !counter-1
   79     !endwhile

ATOM RSS1 RSS2