× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 14 May 2012 11:03, rob@xxxxxxxxx wrote:
I was thinking it was easier that way for simple data structures.

My question is how would SQL handle this for variable length fields?
For example

DCL VAR(MYDS) TYPE(*CHAR) LEN(100)
DCL VAR(&STMT1) TYPE(*CHAR) STG(*DEFINED) LEN(41) DEFVAR(&MYDS 1)
DCL VAR(&STMT2) TYPE(*CHAR) STG(*DEFINED) LEN(1) DEFVAR(&MYDS 41)
DCL VAR(&STMT3) TYPE(*CHAR) STG(*DEFINED) LEN(8) DEFVAR(&MYDS 42)
DCL VAR(&STMT4) TYPE(*CHAR) STG(*DEFINED) LEN(1) DEFVAR(&MYDS 50)
DCL &APOS *CHAR 1 /* Apostrophe */

CHGVAR VAR(&APOS) VALUE(X'7D')
chgvar &stmt1 ('select cola, colb from myfile where colc=')
chgvar &stmt2 &apos
chgvar &stmt3 &myvar
chgvar &stmt4 &apos

It's not going to have a problem since we didn't truncate out the spaces
between &stmt2 and &stmt4 if &stmt3 is equal to XYZ?
Is the above really that much better?


No problem for a WHERE clause for which the trailing blanks are not significant, but not so good for an INSERT. Then try using the value "O'Connor" for the &stmt3. Oops.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.