On Tue, 16 Dec 2025, at 17:58, Lionel B. Dyck wrote:
> This example is one that I played with to learn it a while ago:
>
> in = 'lbdyck.test.pds'
> out = 'lbdyck.test.pdse'
> Address ISPexec
> "lminit dataid(indd1) dataset('"in"')"
Using "indd1" as your intended name of a dataid is a bad idea
because the "dd" in it kind of implies you thought it was a
ddname. It's not.
IF I'd had related ddnames their variable names would probably
have been "dd#i" & "dd#o", with who knows what actual values.
ISTR in my code (years ago) I would have written something like
file#i = 'lbdyck.test.pds'
file#o = 'lbdyck.test.pdse'
Address ISPexec
"lminit dataid(did#i) dataset('"file#i"')"
"lminit dataid(did#o) dataset('"file#o"')"
[You should have checked the rc from both of
those; no point continuing if either didn't
work & if eg the first worked but the second
did not you'd need to lmfree did#i before
stopping.]
"lmcopy fromid("did#i") todataid("did#o")" ,
"frommem(a*) replace"
say 'lmcopy rc:' rc
"lmfree dataid("did#i")"
"lmfree dataid("did#o")"
NB: "#" is how one character (in my ASCII copies of
old code written in the UK) show up in my pc text
editor these days. Whatever I wrote on our z/OS
systems might have been "£" which would possibly
need to be "$" in the US.
--
Jeremy Nicoll - my opinions are my own.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN