View previous topic :: View next topic
|
Author |
Message |
pk2803
New User
Joined: 06 Nov 2008 Posts: 8 Location: uk
|
|
|
|
Hi All,
Please see the below REXX code, it is excuting without any errors.
I have put two member names in input dataset to copy, loop is excuting two times, but members are not getting copied. Can you please help me where i am doing wrong?
Code: |
/* REXX */
SAY 'THIS IS PROGRAM TO Copy selected pds members'
SAY '>>>>>>>>>>>>START PROCESSING<<<<<<<<<<<<'
'EXECIO * DISKR INFILE(FINIS STEM DUMMY.'
ADDRESS 'ISPEXEC'
DO I=1 TO DUMMY.0
MEMNAME = STRIP(LEFT(DUMMY.I,8))
SAY MEMNAME
'LMINIT DATAID(DATA1) DATASET('PAN.TOOL') ENQ(SHR)'
SAY DATA1
'LMINIT DATAID(DATA2) DATASET('OUTPUT.JOBS') ENQ(SHR)'
SAY DATA2
'LMCOPY FROMID('DATA1') TODATAID('DATA2')
FROMMEM(MEMNAME) TOMEM(MEMNAME) REPLACE PACK'
'LMFREE DATAID('DATA1')'
'LMFREE DATAID('DATA2')'
END
SAY '(: END PROCESSING :)'
EXIT |
One question:
Even though i put the dataset names quotes, it is taking my UserID as first qualifier. Please help.
Your help is highly Appreciated.
Regards,
PK |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
1. you never check a RC after an instruction.
2. PAN.TOOL is not a Panvalet PDS is it.
without the RC check, and not using TRACE, nothing else I want to do to help. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
There's no need to place the LMINIT and LMFREE statements inside the loop. They only need to be called once. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Code: |
'LMINIT DATAID(DATA1) DATASET('PAN.TOOL') ENQ(SHR)' |
Quote: |
Even though i put the dataset names quotes, it is taking my UserID as first qualifier. |
The problem is that both rexx and TSO use single quotes in their syntax. For your example, the single quotes act as a delimiter for the host command string. I suggest you use double quotes for the start and end of the command. |
|
Back to top |
|
|
epicdave
New User
Joined: 11 Oct 2007 Posts: 20 Location: New York
|
|
|
|
Pedro wrote: |
Code: |
'LMINIT DATAID(DATA1) DATASET('PAN.TOOL') ENQ(SHR)' |
Quote: |
Even though i put the dataset names quotes, it is taking my UserID as first qualifier. |
The problem is that both rexx and TSO use single quotes in their syntax. For your example, the single quotes act as a delimiter for the host command string. I suggest you use double quotes for the start and end of the command. |
Pedro is correct. You need to double quote the statement so REXX includes the single quote when it parses the statement. Try:
Code: |
"LMINIT DATAID(DATA1) DATASET('PAN.TOOL') ENQ(SHR)" |
|
|
Back to top |
|
|
|