|
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?
As an Amazon Associate we earn from qualifying purchases.
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.