Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
LMMCOPY in Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
Author Message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 8
Location: Calgary, AB

PostPosted: Tue Jul 29, 2008 11:36 am    Post subject: LMMCOPY in Rexx
Reply with quote

Hello there,

I was wondering if any one used LMMCOPY feature in REXX. If so, could you please provide me the sample code. I want to copy a member from a PDS to a flat file and want to use this feature.
Back to top
View user's profile Send private message
References
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3507
Location: Brussels once more ...

PostPosted: Tue Jul 29, 2008 12:10 pm    Post subject:
Reply with quote

LMCOPY is an ISPF service, NOT a function of REXX.

ISPF services are HERE !

Happy reading icon_biggrin.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1930
Location: Israel

PostPosted: Tue Jul 29, 2008 12:11 pm    Post subject:
Reply with quote

LMCOPY has nothing to do with REXX. It is an ISPF Service that you can include in any supported language (including REXX).

The fine ISPF manual contains lots of examples.

O.
Back to top
View user's profile Send private message
Moved: Tue Jul 29, 2008 12:11 pm by ofer71 From CLIST & REXX to TSO/ISPF
sudhakar84

New User


Joined: 20 Jun 2008
Posts: 21
Location: chennai

PostPosted: Tue Jul 29, 2008 1:32 pm    Post subject: Reply to: LMMCOPY in Rexx
Reply with quote

Hi,

Hope this will help u

ADDRESS ISPEXEC
"LMINIT DATASET("Iput") DATAID(inpSID) ENQ(SHR)"
"LMINIT DATASET("Oput") DATAID(OUTSID) ENQ(SHR)"
"LMCOPY FROMID("inpSID") TO DATAID("OUTSID") ",
"REPLACE TRUNC"
IF RC = 0 THEN
DO
"LMFREE DATAID("INPSID")"
"LMFREE DATAID("OUTSID")"
CALL COUNT_RECORDS
SAY ' COPIED' I 'RECORDS SUCCESSFULY'
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3507
Location: Brussels once more ...

PostPosted: Tue Jul 29, 2008 1:41 pm    Post subject:
Reply with quote

sudhakar84

Thank you for the code ...................... however !

When posting code, please be aware that some people will just cut and paste your code and then moan when it doesn't work.

Your code contains an unclosed DO loop, and also a CALL to a routine / procedure which you have not included.

Not a dig at you, but maybe a little cover from those who will cut / paste / moan icon_biggrin.gif
Back to top
View user's profile Send private message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 8
Location: Calgary, AB

PostPosted: Tue Jul 29, 2008 6:05 pm    Post subject: Reply to: LMMCOPY in Rexx
Reply with quote

excellent. Thank you every one for your responses. Thank you Sudhakar for the code. I appreciate your help. I just wanted to get an idea on how this can be achieved and I have it now. Thank you very much.

Thank you expat for the suggestions and I understand your concern about cut/paste/moan icon_lol.gif that some people do but I assure you that I am not one of that kind. icon_wink.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1618
Location: germany

PostPosted: Wed Jul 30, 2008 1:13 pm    Post subject:
Reply with quote

what?

cut/paste/grin??
Back to top
View user's profile Send private message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 8
Location: Calgary, AB

PostPosted: Wed Jul 30, 2008 7:49 pm    Post subject: Reply to: LMMCOPY in Rexx
Reply with quote

Sorry guys, I have one more silly question. I am not able to find answers in the manuals and hence had to fall back on you guys. icon_smile.gif

I'm trying to do the following and am getting a return code of 8. The manual says that the dataid is not created.
"LMINIT DATAID(INPSID) DATASET("my.dataset(member)") ENQ(SHR)"
"LMINIT DATAID(OUTSID) DATASET("my.new.flat.file") ENQ(SHRW)"

Any ideas on why we get RC = 8? Is it wrong to specify the full dataset including the member name in the DATASET field? Should we pre-create the target file before we do an LMINIT on the target file?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3264
Location: Charlotte,NC USA

PostPosted: Wed Jul 30, 2008 7:54 pm    Post subject: Re: Reply to: LMMCOPY in Rexx
Reply with quote

neerajpeddu wrote:
Is it wrong to specify the full dataset including the member name in the DATASET field?


Yes, it is.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1