CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Converting .rpt file code into Perl code

 



jessica_hynes
New User

Jul 2, 2007, 11:21 PM

Post #1 of 4 (999 views)
Converting .rpt file code into Perl code Can't Post

Hi All,

I have a file which contains the following code to generate the report in Oracle



.declare booking_no a13
.declare line_code a10
.declare line_booking a12
.declare book_date a11
.declare taken_by a10
.declare ud a10
.declare ship_name a40
.declare ship_addr1 a40
.declare ship_addr2 a40
.declare ship_addr3 a40
.declare ship_cont a20
.declare ship_phone a20
.declare ship_ref a20
.declare fwdr_name a40
.declare po_no a20
.declare vessel_name a25
.declare voyage a10
.declare etd_origin a11
.declare sail_date a11
.declare origin_name a20
.declare load_name a20
.declare disch_name a20

set page_no 1
.set first "N"
.set no_more_clauses "N"
.declare dest_name a20
.declare disch_code a4
.declare dest_code a4

#dt 1 1 80 #
#dt 2 1 6 9 48 50 61 63 76 80 80 #
#dt 3 1 13 15 34 36 40 42 56 58 62 64 74 75 79 #
#dt 4 1 13 15 49 53 64 66 80 #
#dt 5 1 15 18 52 #

.define lock_tables
lock table booking_table, booking_hazmat, custdata2, edit_table,
booking_rates, printer_table in share update mode
..
.define get_input
select passkey, '//FAX(fax=' || passkey1, passkey2,
passkey3, passkey4, printer_name
into input_booking_seq, fax_header, file_no,
input_print_rates, myNoteId, printer_name
from edit_table
where edit_table.tag = 'BOOKING'
and edit_table.key = 'PRINT'
and edit_table.user_id = user
..
.define get_user_info
select user_location,user_name, user_company, &fax_header || ';style=' || letterhead,
fax_printer, nvl(fax_yn,'N')
into user_location, user_name, user_company, fax_header, fax_printer, fax_yn
from security_header
where user_id = lower(substr(user,5,10))
..
.define get_fax_printer
select &fax_header || ';print = Confirm;printer = ' || &fax_printer || ')'
into fax_header
from dual

.define printMsg
.execute formatMsg
.if "&myNote = 'N/A' " then skipMyNote
.print myNote
.&skipMyNote
.if "&myNoteExt = 'N/A' " then skipMyNoteExt
.print myNoteExt
.&skipMyNoteExt
.add line_count line_count 9
..
.execute lock_tables
.execute get_input
.execute printer_controls
.execute get_top
.execute get_user_info
.execute get_user_office
.rem --------- this section is added to print bookings by file -------
.ifnull file_no skip_by_file
.report get_lots file_loop
.goto skip_to_end
.&skip_by_file
.rem ------------------------------------------------------------------
.if "&fcl_lcl = 'F' " then ck_fcl
.execute adjust_letterhead_lcl
.goto skip_over_fcl
.&ck_fcl
.execute adjust_letterhead_fcl
.&skip_over_fcl
.if "&fax_yn = 'N' " then skip_confirm
.execute get_fax_printer
.goto skip_to_booking
.&skip_confirm
.execute set_no_confirm
.&skip_to_booking
.print_info


I need to code to create a generic parser which actually convert the above code in a .rpt file
into perl code and then finally the perl code could generate the report ...

Please help me out for this to process and suggest me if there is any parser module available for that

Jessica


KevinR
Veteran


Jul 3, 2007, 12:40 AM

Post #2 of 4 (994 views)
Re: [jessica_hynes] Converting .rpt file code into Perl code [In reply to] Can't Post

All I can suggest is you search on CPAN for Oracle modules:

http://search.cpan.org/search?m=all&q=oracle&s=11

and see if there is an existing module that does what you want. Since I do not understand your question, I don't have any other suggestions. Maybe someone else will have a suggestion. If not, try posting on www.perlmonks.com where there are more active and knowledgable perl people.
-------------------------------------------------


(This post was edited by KevinR on Jul 3, 2007, 12:41 AM)


jessica_hynes
New User

Jul 3, 2007, 3:28 AM

Post #3 of 4 (987 views)
Re: [KevinR] Converting .rpt file code into Perl code [In reply to] Can't Post

Hi Kevin!!!

I have searched over CPAN for any Oracle report module bu tdidnt get any proper parser...

I need to make it whole new...

Please suggest me how do I start ?

I will explain u something from the .rpt file......

You can see .declare section which is actually for declaring variables for field width and .define to define

macros but I am not able to understand how could I change it to perl code as nothing macro definition is there

in perl.....



Please look into the file which is actually a raw file to generate the Oracle report ...but I need to change the whole code

into perl


KevinR
Veteran


Jul 3, 2007, 10:26 AM

Post #4 of 4 (983 views)
Re: [jessica_hynes] Converting .rpt file code into Perl code [In reply to] Can't Post

Sorry, but I can't help you with this issue. If nobody else here can. try www.perlmonks.com
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives