FW: Using Comma delimited files with powerhouse
Robert J.M. Edis
Robert.Edis@creatcomp.com
Mon, 8 Mar 1999 13:05:46 -0500
This should work better. :-)
Blue
PowerHouse consultant
Rhode Island, USA
Disclaimer:
The opinions and ideas expressed in this message are my own and have no
relationship to my current employer, Initial Technical Staffing, its client
CCI, or any of CCI's clients.
-----Original Message-----
From: Robert J.M. Edis
Sent: Monday, March 08, 1999 12:58 PM
To: 'Clark, Andrew'
Cc: 'powerh-l@lists.swau.edu'
Subject: RE: Using Comma delimited files with powerhouse
G'day Andrew
I believe you will need to create a defined item for each of the fields in
the input file and assign it with the field value from the input file based
on the position of the commas. The position of each comma can be stored in
additional defined items and derived using the INDEX() function. The
process is messy but works. You will also have to create a variable length
record definition in the PHD (yes Georgia, PH can handle var length files).
----------------------------------------------------------------------------
---
MODE:E ACTION: RECORD Screen
01 Record ASCII256 Auto Defn: M
Status OK
02 File ASCII256 Organization SEQUENTIAL
File Type RMS
Open Name
ASCII256
03 Record Format Variable
----------------------------------------------------------------------------
---
MODE:E ACTION: ITEM Screen
----------------------------------------------------------------------------
---
Record ASCII256 Length 0 Status OK
----------------------------------------------------------------------------
---
Item Type Size Dec Datatype Size Occ Indx
Off
01 RECORD256 C 256 CHARACTER 256 1
02
03
04
The file name ASCII is defined as a VMS logical pointing to the actual data
file. The size 256 can be changed to any size you want.
$QTP
RUN read_csv_file
REQUEST parse_fields
ACCESS ascii256
DEFINE comma1 = INDEX(record256,",")
DEFINE field1 CHAR*??? = record256[1:comma1 - 1]
DEFINE remainder1 CHAR*256 = record256[comma1 + 1:256]
DEFINE comma2 = INDEX(remainder1,",")
DEFINE field2 CHAR*??? = remainder1[1:comma2 - 1]
Etc.
OUTPUT datefile ADD
ITEM column1 FINAL field1
Etc.
There are probably numerous slick variations on this theme. Maybe we can
have a bit of a challenge to see who can come up with the fastest, simplest
method?
Blue
PowerHouse consultant
Rhode Island, USA
Disclaimer:
The opinions and ideas expressed in this message are my own and have no
relationship to my current employer, Initial Technical Staffing, its client
CCI, or any of CCI's clients.
-----Original Message-----
From: Clark, Andrew [SMTP:andrew.clark@acco-uk.co.uk]
<mailto:[SMTP:andrew.clark@acco-uk.co.uk]>
Sent: Wednesday, March 03, 1999 9:36 AM
To: 'PH User Group'
Subject: Using Comma delimited files with powerhouse
Afternoon all (depending where you are of course)
We work on VMS with powerhouse 7.10.e6 & RMS Files
We are getting requests to send out files of info in comma delimited
forms (which we can do very simply) but we are also getting more
information in files sent to us in comma delimited forms. To be
able to
process this info in powerhouse we are having to take this info into
something like MS Access or Excel which can handle the format, and
exporting from this fixed width files, so that we can process it.
Does anyone have any simple way of handling comma delimited files
with
powerhouse, without having to perform this intermediate step?
Regards...
Andrew Clark
ACCO UK LTD
(IT Development)
Tel: 01296 397444 (Ext:4075)
Fax: 01296 311019
Email: andrew.clark@acco-uk.co.uk
<mailto:andrew.clark@acco-uk.co.uk>
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = =
Subscribe: "subscribe powerh-l" in message body to
majordomo@lists.swau.edu <mailto:majordomo@lists.swau.edu>
Unsubscribe: "unsubscribe powerh-l" in message to
majordomo@lists.swau.edu <mailto:majordomo@lists.swau.edu>
powerh-l@lists.swau.edu <mailto:powerh-l@lists.swau.edu> is
gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a
subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.