IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy a PS datset by initiating a macro


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Aug 24, 2007 3:20 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Aug 24, 2007 4:03 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top