HP3000-L Archives

October 1999, Week 2

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:
"VANCE,JEFF (HP-Cupertino,ex1)" <[log in to unmask]>
Reply To:
VANCE,JEFF (HP-Cupertino,ex1)
Date:
Wed, 13 Oct 1999 15:00:19 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
I am glad you got a solution.  I have a comment or two that may
be of general value, from a performance perspective.

> Thanks for you help.  This work great.
> !JOB ....
> ...
> !BUILD CUST001W.PROD;REC=-132,,F,ASCII;MSG;TEMP
> !FCOPY FROM=CUST001W.QUIZ;TO=CUST001W.PROD
Having to make a copy can be costly if the original file is large.

> !WHILE FINFO("CUST001W.PROD","EOF") <> 0
> !   INPUT _RAW_REC < CUST001W.PROD
The INPUT command opens the file, reads the 1st record and closes the
file. This is done for *every* record in the file.  If your file is
10 million records this job will open the file 10 million times, read
a single record 10 million times and do 10 million closes.  Not a
problem with small files, but not recommended for large files.

> !#  DO NOT WORK ON THE SETUP RECORD
> !   IF STR("!_RAW_REC",1,8) <> "12345678"
This next comment is just a pet crusade of mine: you already have
a string variable (_raw_rec) since that is what INPUT creates.  You
will not need to quote the variable (to make it a string) if you
do not explicitly reference it (the "!").  I find it more readable to
simply write:
      IF STR(_RAW_REC,1,8) ...

> !      SETVAR _USER_CODE STR("!_RAW_REC",1,8)
Ditto.  And also you may or may not have trailing blanks depending
on if all of your user codes are 8 characters long.  If you do not
want trailing blanks in the _USER_CODE variable you can do one of the
following:
         SETVAR _USER_CODE rtrim(STR(_RAW_REC,1,8))   or
         SETVAR _USER_CODE word(_RAW_REC)   assuming that a common
                                            delimiter separates the fields.

...

regards,
Jeff Vance, CSY

ATOM RSS1 RSS2