IBM added a new command RUNSQL in V7r1 (in 2012 via ptf) and ptf'd it also
Infocenter has doc on how it works. This is not all the features of iNav or
What IBM did not do is some new way to read files or result sets. But CLP
has always had RCVF to read records in a file,
so the above link to the infocenter has this example
In a CL program, you could use the Receive File (RCVF) command to read the
results of the table generated for this query:
RUNSQL SQL('CREATE TABLE qtemp.worktable AS
(SELECT * FROM qsys2.systables WHERE table_schema = ''MYSCHEMA'') WITH
COMMIT(*NONE) NAMING(*SQL)So I did a test RUNSQL SQL('create table
qtemp.worktable as (select distinct bid from tran) with data') COMMIT(*NONE)
and got a file Display Physical File Member
File . . . . . . : WORKTABLE Library . . . . : QTEMPMember .
. . . . : WORKTABLE Record . . . . . : 1 Control . . . . .
Column . . . . . : 1 Find . . . . . . .
Read the InfoCenter link above for all the limitations. Jim Franz -----
Original Message -----
From: "Hoteltravelfundotcom" <hoteltravelfun@xxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Sent: Sunday, June 01, 2014 7:02 PM
Subject: how to use the Select Distinct