On 10-Apr-2017 11:01 -0500, Alan Shore wrote:
On Mon, Apr 10, 2017 at 9:20 AM, Paul Roy wrote:
On 10-Apr-2017 08:06 -0500, Alan Shore wrote:
How can I create a logical over the physical with a select,
using, for example VALUES, if the value needs to be defined over
more than 1 record
For example
A R FILERECR PFILE(PHYSICALF)
A K KEY1
A K KEY2
A S ERRMSG VALUES('This is just an example of w
A 'hat I mean')
you can just use + or - sign to continue to the next line […]
A S ERRMSG VALUES('This is just an example of w-
A hat I mean')
It's worth noting that they behave differently. The plus sign removes
leading blanks from the next line while the minus sign doesn't
(starting at position 45 of the next line; i.e. the "functions"
field).
A couple examples may have some value to help elucidate [for others,
even if not the OP].?:
* create table qtemp.alan_pf
* ( key1 numeric generated always as identity
* , errmsg char(60) not null with default )
* rcdfmt alanr
* ;
* insert into qtemp.alan_pf (errmsg) values
* ('An example of using plus char for continuation')
* , ('Good example: using dash char for continuation')
* , ('Good example: using minus char for continuation')
* , ('Poor example: using minus char for continuation')
* ;
* call qsys2.qcmdexc ('crtlf qtemp/alan_lf')
* ;
* /* source of ALAN_LF in *LIBL/QDDSSRC: */
DYNSLT
A R ALANR PFILE(ALAN_PF )
A K KEY1
A S ERRMSG VALUES('An example of using plus +
char for continuation' +
'Poor example: using minus-
char for continuation' +
'Good example: using minus-
char for continuation' +
'Good example: using dash -
char for continuation' +
)
In the above "Poor example", the use of the minus sign as line
continuation causes inclusion of the several blanks preceding the word
"char" on the next line; i.e. the selection literal becomes:
'Poor example: using minus char for continuation'
FWiW, the OP should consider whether appropriate or advantageous, the
adding of the file-level keyword DYNSLT to the described LF; as shown in
my example.
Although not the equivalent to what DDS effects in access path
generation, each AccPth created instead with SQL, see the difference in
the Keys for the two files, despite equivalent results in ordered RRNs
retrieved using CPYF FROMRCD(*START) issued against both SQL INDEX; e.g.
using DSPFD FILE(QTEMP/ALAN_X*) TYPE(*ACCPTH):
create index qtemp.alan_xd
on qtemp.alan_pf
( key1 )
where errmsg in
('An example of using plus char for continuation'
,'Good example: using dash char for continuation'
,'Good example: using minus char for continuation'
,'Poor example: using minus char for continuation'
)
;
create index qtemp.alan_xs
on qtemp.alan_pf
( key1, errmsg )
where errmsg in
('An example of using plus char for continuation'
,'Good example: using dash char for continuation'
,'Good example: using minus char for continuation'
,'Poor example: using minus char for continuation'
)
;
As an Amazon Associate we earn from qualifying purchases.