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
 

 

Unable to copy selected members pds to pds.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Unable to copy selected members pds to pds.
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Aug 13, 2010 12:36 am    Post subject: Reply to: Unable to copy selected members pds to pds.
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

Senior Member


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

PostPosted: Fri Aug 13, 2010 7:04 pm    Post subject: Reply to: Unable to copy selected members pds to pds.
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    Post subject: Re: Reply to: Unable to copy selected members pds to pds.
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    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
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


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