HP3000-L Archives

October 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:
Larry Barnes <[log in to unmask]>
Reply To:
Larry Barnes <[log in to unmask]>
Date:
Thu, 18 Oct 2001 15:17:26 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (115 lines)
I must have confused everyone, I've received a few private emails.


When you issue the command file as follows:   CMD1 < *XYZ  the command file
uses the file equation to read a file as input.  It takes each record in the
input file and creates a variable using the record as the value of the
variable.

The input file (myfile) has the following records:

011018
DATA1.MYGROUP.ACCOUNT
OUTFILE
USER1
USER2
USER3

After the command file finishes executing, the following variables would be
created:

var1 = 011018
var2 = DATA1.MYGROUP.ACCOUNT
var3 = OUTFILE  (the name of a file to write output too)
var4 = USER1
var5 = USER2
var6 = USER3

I hope this clears things up.

My purpose of the posting was I didn't know FINFO would accept a file equate
in place of a hard coded file name.



-----Original Message-----
From: Ric Merz [mailto:[log in to unmask]]
Sent: Thursday, October 18, 2001 2:51 PM
To: [log in to unmask]
Subject: Re: [HP3000-L] Back referencing with Finfo


Wouldn't it be easier to just have a parameter on the command as:

PARM FILEIN
setvar cntr 0
while setvar(cntr,cntr+1) <= finfo('!FILEIN','eof')
  input var!cntr <!FILEIN
endwhile
showvar var@

Also, this code only reads the first record of the input file, over and
over again.  You could add code to copy the input file into a message file,
then set your variables from the message file.

Ric


At 12:51 PM 10/18/2001 -0700, you wrote:
>I just hit upon a neat trick.  This maybe old-hat but it's new to me.
>
>I built a command file, we'll call it cmd1.  This command file reads an
>input file to set variables.
>I discovered that I can make this command file very generic for multiple
>uses by setting a file  equate before issueing the command file.
>
>If I set a file equate:  FILE XYZ = MYFILE
>
>When I issue the command file I include the back reference:   CMD1 < * XYZ
>
>The ability for FINFO to read the back-reference is what makes this command
>usefull for many applications, limited only by ones imagination.
>
>Has anyone else out there use a back reference within FINFO before?
>
>here's the command file (CMD1)
>
>setvar cntr 0
>while setvar(cntr,cntr+1) <= finfo('*xyz','eof')
>   input var!cntr < *xyz
>endwhile
>showvar var@
>
>This input file (myfile) contains the following (you can have as many
>records or as few as you need)
>
>011018
>DATA1.MYGROUP.ACCOUNT
>OUTFILE
>USER1
>USER2
>USER3
>.
>.
>.
>.
>
>
>Larry A. Barnes
>Systems Administrator - HP3000
>Coldwater Creek Inc.
>751 W. Hanley Ave.
>Coeur d'Alene, ID  83815-3213
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
Ric
[log in to unmask]

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2