To Quiz or not to Quiz...
David Williams
David_Williams at westbury-homes.co.uk
Mon Jun 13 04:41:38 CDT 2005
A unix script to do it is below, assuming line records have been split in two by quiz.
(It could surely be done in a line or 2 with AWK, but I only use AWK when my back is against the wall, because I can't understand what I did 2 months later.)
rm target.csv ## delete the target file
let COUNT=0 ## initialise toggle counter
## Read through the file "quizreport.txt" produced by quiz as in
## set report device disc name quizreport
## Records are read into variable RECORD
## First in each pair then saved in RECORD1
## When second encountered RECORD1 plus RECORD echoed to target file in
## append mode
cat quizreport.txt | while read RECORD
do
let COUNT=$COUNT+1
if [ $COUNT -eq 1 ]
then
RECORD1=$RECORD
fi
if [ $COUNT -eq 2 ]
then
echo $RECORD1"$RECORD" >> target.csv
let COUNT=0
fi
done
Regards
David
-----Original Message-----
From: powerh-l-bounces+david_williams=westbury-homes.co.uk at lists.sowder.com [mailto:powerh-l-bounces+david_williams=westbury-homes.co.uk at lists.sowder.com] On Behalf Of Joe Boyle
Sent: 10 June 2005 16:53
To: Tremblay.Pierre-McLeod at hydro.qc.ca; powerh-l at lists.sowder.com
Subject: RE: To Quiz or not to Quiz...
I think you could 'Put the record pieces back together afterward' with quiz
as below. But you might have to convert file format_sub_wrt_txt.txt to the
same format as format_sub_wrt_txt_tosf.sf using fdl, as I suspect that one
will be fixed and the other variable.
*__________________Qpass1
can cle
set veri error
set rep pag wid 255
set rep dev dis nam format_sub_wrt_txt spacing 0
set nohead
set pag len 0
access file_list
define LINE_NUM zoned * 6 = 1
rep &
line_num subtot pict "^^^^^^" &
"1" Order_No other items &
SKIP &
line_num subtot pict "^^^^^^" &
"2" more items &
...
...
SKIP &
line_num subtot pict "^^^^^^" &
"N+1" more items
build qz1
*__________________Qpass2
define line_num char * 6 = ""
define line_pos char * 1 = ""
define text_line char * 248 = ""
set subf name format_sub_wrt_txt_tosf keep
rep summ all
build qz2
*__________________Qpass3
Access * format_sub_wrt_txt_tosf
Sorted on line_num
Define string1*248 = text_line if line_pos = 1
Define string2 *248 = text_line if line_pos = 2
Define string3 *248 = text_line if line_pos = 3
...
...
Define stringn *248 = text_line if line_pos = n
set subf at line_num name format_sub_wrt_txt_tosf keep
rep summ string1 max string2 max string3 max ... stringn max
build qz3
then you would run commands as below
quiz
> exe qz1
> exe qz2
> $ delete format_sub_wrt_txt_tosf.sf
> $ copy format_sub_wrt_txt.txt format_sub_wrt_txt_tosf.sf
> exe qz3
Regards, Joe.
________________________________________
From: powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com
[mailto:powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com] On Behalf Of
Tremblay.Pierre-McLeod at hydro.qc.ca
Sent: 10 June 2005 16:30
To: powerh-l at lists.sowder.com
Subject: RE: To Quiz or not to Quiz...
Well,
Thank you all for your answers.
There is no miracle solution for this problem, as I see now. Using the set
subfile in quiz brings back the format problem... I was hoping to avoid
typing back the decimal format because I have to do this for a number of
files.
Well nothing is perfect in this world... (except my mother of course...)
C'est la vie...
Putting the record pieces back together afterward is something I will surely
look at. VAX DCL is very powerful and fun to play with. A couple of code
lines will probably do the job.
Again thank you all. This list is very interesting and helpful.
McLeod
-----Message d'origine-----
De : David Williams [mailto:David_Williams at westbury-homes.co.uk]
Envoyé : 10 juin 2005 05:15
À : Tremblay.Pierre-McLeod at hydro.qc.ca; powerh-l at lists.sowder.com
Objet : RE: To Quiz or not to Quiz...
Pierre
I've done quite a bit of this type of file output, mainly for sending
attachment data to other businesses, or producing files to use in Pivot
table queries on our Intranet.
I've used quiz, qtp, and qdesign.
Started with quiz, which is easiest, and then run into the record size
problem later.
Used qtp and had your format problems (using subfiles from quiz does not
solve this). Hard work.
Then used qdesign to "echo" the files out, using run command on a large
character define made up of the necessary files.. This works fine, but is
harder work than quiz.
(I'm talking about a UNIX (HP-UX) environment - VAX must have equivalent).
Then realised quiz splits the records gracefully (does not break fields),
and even if it did not, one could control the records with skip statements.
So I now use quiz. If the file does not exceed the record size, that's it.
If it does, I just put the record halves back together with a UNIX script
after the quiz. This needs only a few lines in UNIX, and again I assume VAX
can do it easily. (In UNIX if the split is into 2 records, just read, save,
read again, then echo both together to desired file till EOF).
The other advantage of quiz is it's easier to have field name headings, with
initial heading.
Regards
David Williams
________________________________________
From: powerh-l-bounces+david_williams=westbury-homes.co.uk at lists.sowder.com
[mailto:powerh-l-bounces+david_williams=westbury-homes.co.uk at lists.sowder.co
m] On Behalf Of Tremblay.Pierre-McLeod at hydro.qc.ca
Sent: 09 June 2005 22:14
To: powerh-l at lists.sowder.com
Subject: To Quiz or not to Quiz...
Hi everybody,
I'm trying to extract powerhouse data to an ASCII file keeping the correct
dictionary picture format.
Using Quiz, everything is OK, it's like a report, so the numbers are
formatted according to the dictionary format without having to specify a
picture for every field. Good! But, I cannot exceed the 263 characters
barrier for a record. It wraps the line. ... hum... too bad...
Using QTP, I don't have the wraparound problem but the format of the fields
is catastrophic. Presented as they are stored on file, without any decimal
format, the numbers are useless.
There is certainly a way to create records more than 263 characters long in
Quiz or to use the dictionary format in QTP ?
Surely I'm missing something.... ?
I'm talking about powerhouse 7.10.E sitting on a vax computer running
OpenVMS 6.2
Thank's !
Best regards.
Pierre McLeod Tremblay
Consultant T.I. / I.T. Consultant
pmcleod at videotron.ca
819.263.0791 fax: 819.263.0792
My french is better than my english. Sorry for the Frenglish...
**********************************************************************
The above information is confidential to the Addresse and may be privileged.
Unauthorised access and use is prohibited.
Internet communications are not secure and therefore this Company does not
accept legal responsibility for the contents of this message.
If you are not the intended recipient, any disclosure, copying, distribution
or any action taken or omitted to be taken in reliance on it, is prohibited
and may be unlawful.
**********************************************************************
--
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: "subscribe" in message body to powerh-l-request at lists.sowder.com
Unsubscribe: "unsubscribe <password>" in message body to 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.
**********************************************************************
The above information is confidential to the Addresse and may be privileged. Unauthorised access and use is prohibited.
Internet communications are not secure and therefore this Company does not accept legal responsibility for the contents of this message.
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
**********************************************************************
More information about the powerh-l
mailing list