IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

LMMCOPY in Rexx


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Jul 29, 2008 12:10 pm
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: 2358
Location: Israel

PostPosted: Tue Jul 29, 2008 12:11 pm
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: 25
Location: chennai

PostPosted: Tue Jul 29, 2008 1:32 pm
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: 8797
Location: Welsh Wales

PostPosted: Tue Jul 29, 2008 1:41 pm
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
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
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
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

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jul 30, 2008 7:54 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top