Page 1 of 1

How to Copy a Dataset to New dataset?

PostPosted: Fri May 04, 2012 5:27 pm
by pjagathis
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.

Re: How to Copy a Dataset to New dataset?

PostPosted: Fri May 04, 2012 5:30 pm
by Akatsukami
Remember that, under TSO, a DSN not enclosed in single quotes will be prefixed with your assigned HLQ (probably your ID).

Re: How to Copy a Dataset to New dataset?

PostPosted: Fri May 04, 2012 5:36 pm
by pjagathis
Hi,

Thanks..! It Worked..!

I need one more help.

How to allocate a Dataset with same Input dataset Properties.

Re: How to Copy a Dataset to New dataset?

PostPosted: Fri May 04, 2012 7:01 pm
by MrSpock
Run the command TSO HELP ALLOCATE. Look at the details of the LIKE parameter.

Re: How to Copy a Dataset to New dataset?

PostPosted: Fri May 04, 2012 7:06 pm
by prino
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...)