Re: ACE to 4GL
Posted in 1998
Jonathan Knight wrote: > > Has anyone come across a tool to convert an ACE report to a 4GL > automatically? I'd thought I'd ask before reinventing the wheel. > > Jon > > Jon Knight > > Rebus Insurance Systems Ltd, 120 Leman Street, London, E1 8EU > Tel: 0171 488 4080 jknight@fusiond.com The following is a sloppy hack I have used. It includes many things specific to the way I wrote my ACE reports. You're welcome to try it. It got some of the simple drudge done for me. No doubt someone has a more sophisticated tool. ACE24GL(4GL) ACE24GL(4GL) Name ace24gl - convert ACE script to Informix 4GL Syntax ace24gl <file.ace >file.4gl Description ace24gl is a filter to assist with conversion of Informix SQL ACE report scripts to Informix 4GL driver and report programs. It converts all functions in atsacego(ATS) to their 4GL library equivalents except wrap(ATS, 4GL), which requires some reworking. Miscellaneous bits and pieces are inserted and edited to help with conversion. All begin, end pairs are assumed to belong to if statments and so end is converted to end if. The else if construct of ACE is highlighted. Many end if statements will be needed after single-line if blocks. Limitations Much is not done. The output block must be moved. --- start of shell script --- #!/bin/sh # %W% some help in converting ACE to 4GL reports sed ' /^[ ]*function/d s/then begin/then/ s/else begin/else/ s/end/end if/ s/else if/ELSE IF/ s/\\\\/\\~/g s/cliplen(/length(/g s/printf(/fgl_printf(/g s/printgs(/cause_growth_stage(/g s/printunit(/fgl_format_units(/g s/sub(/stsub(/g s/shell(/SHELL(/ /database ats/{ s/ end if// a\\ define r record\\ end record } /define/i\\ function X() s/param\\[.\\]/define/ /select/i\\ declare c_X cursor for /page length/i\\ top of page "^J" /^[ ]*format/i\\ start report X_rpt\\ foreach c_X into r.*\\ output to report X_rpt()\\ end foreach\\ finish report X_rpt\\ \\ free c_X\\ \\ end function\\ \\ \\ report X_rpt()\\ /wrap(/a\\ -- requires GLOBAL g_wrap_in ' $* -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 Mail: Peter.Lancashire.PL1@bayer.co.uk --- My Internet plumbing does not allow me to mail and post news together. Sorry. All opinions are my own and not those of Bayer plc. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/