Reading a flat file with Cognos
Latimer, Richard
richard.latimer at airways.co.nz
Sun Jun 25 01:50:43 CDT 2006
Easy peasy (provided you can get PH to read the file and the number of
fields to be extracted is known)
It is most easily done in QTP, taking advantage of it's ability to
redefine temps as it goes. The snippet below is not as explanatory as I
would have liked but I can't find a better one ...
First DEFINE your delimiter, your text string and the length of the
string (t_com, t_rec, and t_len in the example) and set TEMP's for the
start and end (in the example 'str' and 'endd')
Set your start item to 1 ( or the first valid character in the record)
and use the INDEX command to find the delimiter character. Your first
field is then 1 to index - 1. ('strt' to 'endd')
Redefine your start item to be the same as 'endd' and use INDEX to
search the rest of the string for the next delimiter. You now have the
second item ('strt' to 'endd' - 1 again)
Repeat until done ...
; Header
ITEM strt = 1
ITEM endd = index(t_rec{strt:t_len - strt},t_com)
ITEM t_header = t_rec{strt : endd - 1}
; ACNZ99 ;Callsign and flight plan no.
ITEM strt = strt + endd
ITEM endd = index(t_rec{strt:t_len - strt},t_com)
ITEM t_nas99 = t_rec{strt : endd - 1}
; NAS03 ;Wake Turb/aircraft type
ITEM strt = strt + endd
ITEM endd = index(t_rec{strt:t_len - strt},t_com)
ITEM t_nas03 = t_rec{strt : endd - 1}
; NAS26 ;Depart point
ITEM strt = strt + endd
ITEM endd = index(t_rec{strt:t_len - strt},t_com)
ITEM t_nas26 = t_rec{strt : endd - 1}
Cheers
Richard
-----Original Message-----
From: powerh-l-bounces+richard.latimer=airways.co.nz at lists.sowder.com
[mailto:powerh-l-bounces+richard.latimer=airways.co.nz at lists.sowder.com]
On Behalf Of Matthew Cox
Sent: Saturday, 24 June 2006 8:00 a.m.
To: powerh-l at lists.sowder.com
Subject: Reading a flat file with Cognos
Is it possible to read a delimited flat file with Quiz or QTP? I have
information from another platform that I would like to update in my
Powerhouse application without spending thousands on an ODBC driver.
Thanks,.
Matt
--
= = = = = = = = = = = = = = = = = = = = = = = = = = = = 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.
Add 'site:lists.sowder.com powerh-l' to your search terms to search the
list archive at Google.
**********************************************************************
This electronic message together with any attachments is confidential. If
you receive it in error: (i) you must not use, disclose, copy or retain
it; (ii) please contact the sender immediately by reply email and then
delete the emails. Views expressed in this email may not be those of the
Airways Corporation of New Zealand Limited
**********************************************************************
More information about the powerh-l
mailing list