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

Unable to copy selected members pds to pds.


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pk2803

New User


Joined: 06 Nov 2008
Posts: 8
Location: uk

PostPosted: Thu Aug 12, 2010 11:00 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 12, 2010 11:43 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Aug 13, 2010 12:36 am
Reply with quote

There's no need to place the LMINIT and LMFREE statements inside the loop. They only need to be called once.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Aug 13, 2010 7:04 pm
Reply with quote

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
View user's profile Send private message
epicdave

New User


Joined: 11 Oct 2007
Posts: 20
Location: New York

PostPosted: Wed Sep 01, 2010 9:07 pm
Reply with quote

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
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top