[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] (no subject)



First off.. Thanks for the quick responses... but I am not quite
understanding the few suggestions I have received.  This code was written by
a co-worker and so I am still actually trying to figure out how he is doing
this.  Here are the lines I am currently using I hope this may help.  

open 'combine.csv' as 1  for-writing record=1000:vary
            write 1 from    '"NBR","LEVEL1","LEVEL2","SER-NBR"... <---  more
follows
        DO MASTER
begin-procedure MASTER
open 'S:\Staff\Dlemos\SQRDev\combine.txt' as 10 for-reading record=6100

while 1
   read 10 into                                 $n:1 
                    $NBR:10                     !2
                                                $n:10
                    $LEVEL1:2                   !22
                    $LEVEL2:4                   !24
                                                        $n:65
                    $SER-NBR:20 !93
                                                        $n:31
                    $CODE-SALESMAN:2    !144
                                                        $n:3
(.... this continues on....)

    if #end-file
        break
    end-if

end-while
    close 10
    close 1
end-procedure


-----Original Message-----
From: bpelton@communitymedical.org [mailto:bpelton@communitymedical.org]
Sent: Tuesday, November 12, 2002 12:52 PM
To: sqr-users@sqrug.org
Subject: Re: [sqr-users] (no subject)



Immediatly after openning the file, read one line into a dummy variables.

  let $filename = '{FILEPREFIX}' || $filename
  open $filename as 10 for-reading record=70

  read 10 into $ignore_first_line:70

  while #end-file = 0
      do read-next-line
      if #end-file = 0
          let $valid = $yes
          do validate-emplid
          do validate-dedcd
          if $valid = $yes
              do check-existing-record
              if $exists = $yes
                  do update-deduction-record
              else
                  do write-deduction-record
              end-if
          else
              do print-error
          end-if
      end-if
  end-while


Brian Pelton
System Analyst
Community Medical Centers





Dan Lemos <dlemos@aeacu.com>@sqrug.org on 11/12/2002 12:44:10 PM

Please respond to sqr-users@sqrug.org

Sent by:    sqr-users-admin@sqrug.org


To:    "'sqr-users@sqrug.org'" <sqr-users@sqrug.org>
cc:
Subject:    [sqr-users] (no subject)


Is it possible to open a file for reading but have it skip the first line
in
this file?  The first line is a header and the data I need to pull from
this
file starts under this header.

Currently I am manually opening this file and deleting the first line but
would like to see if I can have this automated.

The file I am opening is a flat file with a fixed length layout.
Any help is appreciated.
Dan

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users




_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users