View previous topic :: View next topic
|
Author |
Message |
neerajpeddu
New User
Joined: 03 Feb 2006 Posts: 25 Location: Calgary, AB
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
sudhakar84
New User
Joined: 20 Jun 2008 Posts: 25 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
Back to top |
|
|
neerajpeddu
New User
Joined: 03 Feb 2006 Posts: 25 Location: Calgary, AB
|
|
|
|
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 that some people do but I assure you that I am not one of that kind. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what?
cut/paste/grin?? |
|
Back to top |
|
|
neerajpeddu
New User
Joined: 03 Feb 2006 Posts: 25 Location: Calgary, AB
|
|
|
|
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.
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
neerajpeddu wrote: |
Is it wrong to specify the full dataset including the member name in the DATASET field? |
Yes, it is. |
|
Back to top |
|
|
|