Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8657
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: 8657
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 set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts Image copy after Online reorganization. lind sh IMS DB/DC 0 Tue Jan 30, 2018 9:58 pm
No new posts Copy Specific Groups V S Amarendra Reddy SYNCSORT 10 Thu Jan 11, 2018 1:16 am
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us