View previous topic :: View next topic
|
Author |
Message |
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Hi Friends,
I need to make a copy a PS.
I will be given with a dataset on initiating a macro it should make a copy of the dataset.
1. I need to allocate the dataset similar to that of the source ?
2. I need to copy the content from src -> dest.
How can i proceed with this req.
Any suggestions ?
Thanks,
Diwakar
------------------------
Nobody is Perfect. I am Nobody |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
This is the code ur asking for!!
on executing the following, u can copy the content to a new DS.
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/* REXX program */
/* */
/* DUPLIC is for use in the 3.4 option - input DUPLIC in the command */
/* area of the dataset you wish to copy */
/* TEH */
trace off
address ispexec
"VGET (zdldsn) SHARED"
say 'Input name of output dataset'
pull outname
outname = translate(outname," ","'")
outname = strip(outname)
listrc = listdsi("'"zdldsn"'")
select
when length(sysrecfm) = 1 then
nop
when length(sysrecfm) = 2 then
sysrecfm = insert(' ',sysrecfm,1)
when length(sysrecfm) = 3 then do
sysrecfm = insert(' ',sysrecfm,1)
sysrecfm = insert(' ',sysrecfm,3)
end
end
if sysunits = 'BLOCK' then do
sysunits = ''
end
/* ---------------------------------------------------------------- */
/* Allocate DD names for IEBGENER */
/* ---------------------------------------------------------------- */
address tso
"FREE DDN(SYSIN SYSPRINT)"
"ALLOCATE DDN(SYSIN) DUMMY"
"ALLOCATE SYSOUT(T) DDN(SYSPRINT)"
"ALLOCATE DDN(SYSUT1)",
"DSNAME('"zdldsn"') SHR"
"ALLOCATE DDN(SYSUT2)",
"DSNAME('"outname"') NEW CATALOG",
"DSORG("SYSDSORG") RECFM("SYSRECFM") LRECL("SYSLRECL") BLKSIZE("SYSBLKSIZE")",
"SPACE("SYSPRIMARY","SYSSECONDS") "SYSUNITS"",
"UNIT(SYSDA)"
"IEBGENER"
saverc = rc
"FREE DDN(SYSUT1 SYSUT2)"
exit saverc |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
But why not just run IEBGENER from JCL rather than within REXX
What is the need for using REXX ??? |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Hi All,
Thanks Vamsi..
Expat i am trying to create a macro which will duplicate the dataset.
I thought the macro will simplify the process..
Any suggestions expat ?
thanks,
Diwakar
-------------------
Nobody is Perfect. I am Nobody |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
My suggestions depend on the work that is going on at the time.
If the dataset is large, then your terminal will be locked out until the task has completed. Also, the more work that your TSO session does, the more likeley it is to be dynamically placed in a lower TSO performance group, which then affects EVERYTHING that you do after that point.
Running this macro may be enough to drop you from group 1 to group 4 in one go. That's why if it a large task and is possible in batch, then do it in batch, and not affect your TSO performance status. |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
i agree with u EXPAT |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
pat,
Thanks for tour suggestion.
whatever you told is right. I am going to use this command only samll datasets.
How about converting the above code to a macro ?
Thanks,
Diwakar
----------------------------
Nobody is Perfect. I am Nobody |
|
Back to top |
|
|
|