[Info-vax] Coding Excel files...

David Froble davef at tsoft-inc.com
Wed Feb 12 19:06:46 EST 2014


VAXman- @SendSpamHere.ORG wrote:
> In article <ldg9ak$soa$1 at news.albasani.net>, Jan-Erik Soderholm <jan-erik.soderholm at telia.com> writes:
>> {...snip...}
>>
>> Not at all. The data is usualy in some Rdb table (written by the
>> Cobol applications) and some batch job runs Python and creates
>> the XLS files (using the Python Rdb interface and the Excel
>> tools). Sometimes the Cobol code submittes the batch job or
>> it can be done using a table trigger.
> 
> Good grief.  I hate COBOLlers LIB$SPAWNing shit all over the place.  I hate
> it even more when the LIB$SPAWN a SUBMIT command.
> 

There can be conditions where spawning a sub-process or a detached 
process is reasonable.  With a SPAWN/NOWAIT you can move on to other 
work while <whatever> completes in the background.

> 
>> Another Cobol app writes data to a table and a table trigger
>> submittes a job that uses the Python PDF ("ReportLab") tools
>> to create PDF reports (accessed through the web server, WASD).

Don't know what "table trigger" is ???

> So, if I've read you right, you're running a Python script in a BATCH job to
> convert tabled data to XLS.
> 

I'd stay out of the batch queues, but that's just me ...

> 
>> I'm sure Perl works fine also, but I personaly don't like Perl. :-)
>> Python feels more "modern" and structured.
> 
> No real PERL (save to figure out how well the class libraries handled the
> Excel output.  I link those bits into C code which the customer can call
> from their COBOL.  The most COBOL I ever wrote was to show them how to do
> the call.  Strange, they'd never seen the:
> 
>   INSPECT blah-blah TALLYING blah-blah-LEN FOR CHARACTERS BEFORE SPACES.

Never saw that one before ..

> ...syntax before I'd used it.  I thank Google for that COBOL syntax.
> 
> They then invoke the call:
> 
>   CALL "Table2Excel" USING BY DESCRIPTOR table-data-descriptor
>                            BY DESCRIPTOR Excel-FILE(1:Excel-FILE-LEN)
>                            BY DESCRIPTOR Image-FILE(1:Image-FILE-LEN)
>                            BY DESCRIPTOR "Orange"  <==header bg color
>                            BY DESCRIPTOR "Black"   <==header fg color
>                      GIVING RET-STATUS.

Knew there was a reason I avoid Cobol ...


> There's no need for unnecessary process creation and waiting about for 
> that process to complete.  It's all done, and quite quickly too, in the
> context of the caller.
> 

If it's quick, then yeah, I'd do it in line.  If it's not so quick, I'd 
consider a sub-process.  Then there are places where the task is much 
easier in a sub-process, such as executing a DCL procedure.  I won't 
write code when $ COPY A.A B.B is much simpler.



More information about the Info-vax mailing list