Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
View previous topic :: :: View next topic  
Author Message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 25
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

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

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: 2360
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
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: 8593
Location: Back in jolly old England

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: 25
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

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: 25
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: 4648
Location: Raleigh, 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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us