[Info-vax] COBOL Is Obsolete (was Re: Any stronger versions of the LMF planned ?)

Arne Vajhøj arne at vajhoej.dk
Thu Sep 23 16:51:33 EDT 2021


On 9/22/2021 9:48 PM, Lawrence D’Oliveiro wrote:
> On Wednesday, September 22, 2021 at 9:38:28 PM UTC+12, Jan-Erik Söderholm wrote:
>>> COBOL was born back in the era of ISAM files, and never really adapted to
>>> the widespread adoption of SQL and relational databases.
>>
>> That is a complete BS, of course. As anyone really understanding
>> these matters understand.
> 
> Let me repeat the example I started this discussion with, namely constructing a where-clause from a set of input field values in Python with something like
> 
> 	where_clause = " and ".join \
> 	  (
> 		"%s = %s" % (field_name, format_sql_value(params[field_name]))
> 		for field_name in params
> 		if params[field_name] != ""
> 	  )
> 
> (i.e. only filter on fields where the user actually entered a value).
> 
> Try doing the same in COBOL, and you might understand better what I mean.

I already posted an example of how to do that in Cobol with
embedded SQL with the help of COALESCE.

Is it elegant? No - but it gets the job done.

Arne





More information about the Info-vax mailing list