How to Copy a Dataset to New dataset?



IBM's Command List programming language & Restructured Extended Executor

How to Copy a Dataset to New dataset?

Postby pjagathis » Fri May 04, 2012 5:27 pm

Hi,

I am new to REXX. I am interested to write small programs.

At first I tried to Copy a Dataset to NEW Dataset.

Code Used:

/* Rexx */                                                       
"Alloc DA(Xxx.Test.Input) F(INDD) SHR REUSE"                     
"Alloc DA(Xxx.Test.Output) F(OUTDD) MOD REUSE"                   
SAY 'Copying ...'                                               
"EXECIO * DISKR INDD (FINIS"                                     
QUEUE ''   /* Insert a null line at the end to indicate end of */
"EXECIO * DISKW OUTDD (FINIS"                                   
SAY 'Copy complete.'                                             
"FREE F(INDD OUTDD)"                                             
EXIT 0                                                           




But it is saying not able to access the input dataset.

Your help is very much appreciated.

I have just programming this for learning.
Thanks and Regards,
Jagathis P
pjagathis
 
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time

Re: How to Copy a Dataset to New dataset?

 

Re: How to Copy a Dataset to New dataset?

Postby Akatsukami » Fri May 04, 2012 5:30 pm

Remember that, under TSO, a DSN not enclosed in single quotes will be prefixed with your assigned HLQ (probably your ID).
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: How to Copy a Dataset to New dataset?

Postby pjagathis » Fri May 04, 2012 5:36 pm

Hi,

Thanks..! It Worked..!

I need one more help.

How to allocate a Dataset with same Input dataset Properties.
Thanks and Regards,
Jagathis P
pjagathis
 
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time

Re: How to Copy a Dataset to New dataset?

Postby MrSpock » Fri May 04, 2012 7:01 pm

Run the command TSO HELP ALLOCATE. Look at the details of the LIKE parameter.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: How to Copy a Dataset to New dataset?

Postby prino » Fri May 04, 2012 7:06 pm

pjagathis wrote:I have just programming this for learning.

Then maybe your tutor should have told you never to use EXECIO to copy datasets. Try your code on a dataset with 16 billion records... (Suggestion, do it in batch and specify REGION=0M on your exec step, and maybe we are lucky...)
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post