Number of records of a subfile in Qdesgin/UNIX?
John MacLerran
macljohn at isu.edu
Thu Sep 20 15:32:45 CDT 2007
How about this?
In your calling screen, fire off a 'run command..' that invokes a
shell script which does the following:
1. 'cat file | wc -l' into a variable ... e.g. rec_count=$(cat
subfile | wc -l)
2. Run quick, with an AUTO= parameter to run a second screen that
2a. does a getsystemvalue(rec_count) and puts that value into a
table in the database somewhere and
2b exits without displaying the screen
3. Then, your calling screen could query the database and get the record
count.
You might be able to do all of step 2a in the initialize procedure and
finish it with a RETURN verb to make it go back without displaying
anything. The whole technique would be like running an external ghost
screen. The quick process in step 2 would be logically in the same
child process as the variable assignment, so it should be able to see
the variable, and storing it in the database would make it persistent so
the original screen could retrieve it.
Does that sound feasible?
Daniel Rodríguez wrote:
> We use the number of records to know if we have to do a FTP, a
> Reflection Transfer or if a subfile which has to be exported to excel
> has more tan 65645 records (excel limit)... not only for display the
> information...
>
> Daniel
>
>
>
> 2007/9/20, Guy Werry <guy.werry at hbms.ca <mailto:guy.werry at hbms.ca>>:
>
> Ok, we have a subfile, a portable one, on HP-Ux and we need to
> know how many records, then display that in a Quick screen.
> We do something similar with many of our reports.
>
> 1) Write a Quiz report that will report the number of records,
> with REPORT DEVICE DISC NAME (name to be chosen, use "FRED" as an
> example).
> 2) In your Quick screen, RUN COMMAND "more FRED.txt" CLEAR SCREEN
> RESPONSE
>
> So, the disc file FRED.txt will have Quiz's report of how many
> records it read (yes, a bit slower than wc -l, but life's not
> perfect). The Quck screen will use the more utility to report the
> contents of FRED.txt on your screen. Life is wonderful!
>
>
> Guy L. Werry
> Senior Systems Analyst
> Hudson Bay Mining & Smelting Co., Limited.
>
>
> ------------------------------------------------------------------------
> *From:* powerh-l-bounces+guy.werry=hbms.ca at lists.sowder.com
> <mailto:hbms.ca at lists.sowder.com>
> [mailto:powerh-l-bounces+guy.werry=hbms.ca at lists.sowder.com
> <mailto:powerh-l-bounces+guy.werry=hbms.ca at lists.sowder.com>] *On
> Behalf Of *Daniel Rodríguez
> *Sent:* Thursday, September 20, 2007 10:10 AM
> *To:* Franck LERAY
> *Cc:* powerh-l at lists.sowder.com <mailto:powerh-l at lists.sowder.com>
> *Subject:* Re: Number of records of a subfile in Qdesgin/UNIX?
>
> Hi,
>
> I think we don't have a C compiler installed in the news HP9000...
> I will see...
>
> If not, maybe I can write the result of the 'wc -l' into a file,
> convert it to a fixed length and read it as a subfile... it's just
> an idea...
>
> Thank you,
>
> Daniel
>
> 2007/9/20, Franck LERAY <franck.leray at cheops.fr
> <mailto:franck.leray at cheops.fr>>:
>
> Hi Daniel,
>
>
>
> You need to make a script which displays the number of records
> and a c stub. The c program return the number of records to
> the quick program. We use this feature in differents cases and
> use popen to call the script shell in the c program.
>
>
>
> Franck.
>
>
>
>
>
> ------------------------------------------------------------------------
>
> *De :* Daniel Rodríguez [mailto:reasegurator at gmail.com
> <mailto:reasegurator at gmail.com>]
> *Envoyé :* jeudi 20 septembre 2007 13:45
> *À :* Franck LERAY
> *Cc :* powerh-l at lists.sowder.com
> <mailto:powerh-l at lists.sowder.com>
> *Objet :* Re: Number of records of a subfile in Qdesgin/UNIX?
>
>
>
> Hi Frank,
>
> We use these portable subfiles to export it to SAP,
> Streamserve, excel and other aplicactions and we write the
> carriage return in each line of the subfile, so the command
> 'wc -l' works properly.
>
> I will try with the DO EXTERNAL option calling a Unix shell
> script.
>
> Merci beaucoup pour l'aide, Frank! Je suis spagnol et écrire
> en anglais est aussi trés compliqué pour moi.
>
> Daniel Rodriguez,
>
>
>
> 2007/9/20, Franck LERAY <franck.leray at cheops.fr
> <mailto:franck.leray at cheops.fr>>:
>
> On unix box, you can't use the same method.
>
>
>
> 2 problems
>
> First
>
> You can't use do command statement, a variable set by a soon
> process is not visible from the parent process.
>
> You have to do an external subroutine (callable by the do
> external command).
>
>
>
> Second
>
> The "wc –l" command will not work like on 3k platform because
> on unix there's no carriage return in the subfile. So the wc
> –l command will not return the number of records.
>
> You have to do a unix script. This script will use the qshow
> command. This command will return the number of records.
>
>
>
> Hope this help (excuse my poor English….)
>
> Franck.
>
>
>
>
>
>
> --
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Mailing list: powerh-l at lists.sowder.com
> <mailto:powerh-l at lists.sowder.com>
> Subscribe: "subscribe" in message body to
> powerh-l-request at lists.sowder.com
> <mailto:powerh-l-request at lists.sowder.com>
> Unsubscribe: "unsubscribe <password>" in
> message body to powerh-l-request at lists.sowder.com
> <mailto:powerh-l-request at lists.sowder.com>
> http://lists.sowder.com/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a
> subscriber.
> Add 'site: lists.sowder.com <http://lists.sowder.com>
> powerh-l' to your search terms to search the list archive at
> Google.
>
>
>
>
> The information in this e-mail and any attachments is confidential
> and may be subject to legal professional privilege. It is intended
> solely for the attention and use of the named addressee(s). If you
> are not the intended recipient, or person responsible for
> delivering this information to the intended recipient, please
> notify the sender immediately. Unless you are the intended
> recipient or his/her representative you are not authorised to, and
> must not, read, copy, distribute, use or retain this message or
> any part of it.
>
> --
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Mailing list: powerh-l at lists.sowder.com
> <mailto:powerh-l at lists.sowder.com>
> Subscribe: "subscribe" in message body to
> powerh-l-request at lists.sowder.com
> <mailto:powerh-l-request at lists.sowder.com>
> Unsubscribe: "unsubscribe <password>" in message
> body to powerh-l-request at lists.sowder.com
> <mailto:powerh-l-request at lists.sowder.com>
> http://lists.sowder.com/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a
> subscriber.
> Add 'site: lists.sowder.com <http://lists.sowder.com> powerh-l' to
> your search terms to search the list archive at Google.
>
>
--
----------------------------------------------------------------------
John MacLerran http://picasaweb.google.com/jmaclerran
IT Analyst, Senior email: macljohn at isu.edu
Idaho State University V(208) 282-2954
http://www.isu.edu/~macljohn F(208) 282-3673
----------------------------------------------------------------------
More information about the powerh-l
mailing list