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
 

 

Copy a PS datset by initiating a macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Fri Aug 24, 2007 2:42 pm    Post subject: Copy a PS datset by initiating a macro
Reply with quote

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

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Aug 24, 2007 2:50 pm    Post subject: Reply to: Copy datset using REXX
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 24, 2007 3:20 pm    Post subject:
Reply with quote

But why not just run IEBGENER from JCL rather than within REXX

What is the need for using REXX ???
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Fri Aug 24, 2007 3:26 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 24, 2007 4:03 pm    Post subject:
Reply with quote

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

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Aug 24, 2007 4:13 pm    Post subject: Reply to: Copy datset using REXX
Reply with quote

i agree with u EXPAT
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Fri Aug 24, 2007 4:15 pm    Post subject:
Reply with quote

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
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 copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm


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