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
 

 

Copying dataset to new dataset using rexx?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
aishwarya_singh

New User


Joined: 06 Apr 2005
Posts: 21

PostPosted: Mon Jul 24, 2006 12:45 pm    Post subject: Copying dataset to new dataset using rexx?
Reply with quote

Hi,

Can we copy a dataset which is in TAPE unit ?Or Can we allocate a Dataset in TAPE instead of DASD? If so then what is the parameter for Unit in Rexx. Can anyone help me on this?
Back to top
View user's profile Send private message

saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Mon Jul 24, 2006 3:44 pm    Post subject:
Reply with quote

Hi Aishwarya,

Yes ! u can copy the data in a tape to a ps . But, why u want to use rexx for that ? it can be done by a simple jcl .


Code:

//COPY01     EXEC PGM=IEBGENER                                 
//SYSPRINT   DD SYSOUT=*                                       
//SYSOUT     DD SYSOUT=*                                       
//SYSUT1     DD DSN=P.AB.F111.CLW999.MTDBKP.G1184V00,DISP=SHR,
//             UNIT=TAP8,VOL=SER=000249                       
//SYSUT2     DD DSN=XVZSTSO.TRY,DISP=(NEW,CATLG),             
//           SPACE=(CYL,(200,200),RLSE)                       
//SYSIN      DD DUMMY                                         
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Jul 24, 2006 4:13 pm    Post subject: Re: Copying dataset to new dataset using rexx?
Reply with quote

I agree. REXX has no built-features for copying datasets, or for even allocating datasets (that's a function of the operating system environment). There are no REXX statements with regards to UNIT.
Back to top
View user's profile Send private message
aishwarya_singh

New User


Joined: 06 Apr 2005
Posts: 21

PostPosted: Mon Jul 24, 2006 5:01 pm    Post subject: Re: Copying dataset to new dataset using rexx?
Reply with quote

Actually i am preparing one rexx program which will copy BULK of Datasets into new datasets. Here i am using 'Like' keyword to allocate new datasets. But this program is running only for DASD datasets not for the datasets which are in TAPE.

It means there is no way in rexx where we can copy the TAPEC datasets to a new dataset.
Or

If we can copy a dataset in DASD to new dataset which will be in TAPE.

?????????
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Jul 24, 2006 6:51 pm    Post subject: Re: Copying dataset to new dataset using rexx?
Reply with quote

You've completely lost me. REXX has no keyword "like". That sounds like a keyword parameter of a JCL DD statement, or of an operand of a TSO "ALLOCATE" command or of an IDCAMS "ALLOCATE" command.

TSO users cannot normally allocate datasets onto TAPE unless they have been given special tape mount authority by the Sys Admins. Batch jobs, which I presume we are talking about here, should have no problems allocating TAPE datasets.
Back to top
View user's profile Send private message
aishwarya_singh

New User


Joined: 06 Apr 2005
Posts: 21

PostPosted: Tue Jul 25, 2006 10:57 am    Post subject:
Reply with quote

Hi,

I am using this code:-
Code:

TRACE O                                                                         
ADDRESS ISPEXEC                                                                 
STATUS = MSG('OFF')                                                             
'CONTROL ERRORS RETURN'                                                         
CNT = 1                                                                         
CPCNT = 0                                                                       
GCCHKDS1='''XXXXXX.BULKCOPY.INPUT'''/*DATASET WHICH CARRIES I/P FILENAMES*/         
GCCHKDS2='''XXXXXX.BULKCOPY.OUTPUT'''/*DATASET WHICH CARRIES O/P FILENAMES*/       
ADDRESS TSO 'ALLOC FI(DDN1) DA('GCCHKDS1') SHR KEEP'                           
ADDRESS TSO 'EXECIO * DISKR DDN1(STEM PSNAM1. FINIS)'                           
ADDRESS TSO 'FREE F(DDN1)'                                                     
ADDRESS TSO 'ALLOC FI(DDN2) DA('GCCHKDS2') SHR KEEP'                           
ADDRESS TSO 'EXECIO * DISKR DDN2(STEM PSNAM2. FINIS)'                           
ADDRESS TSO 'FREE F(DDN2)'                                                     
DO WHILE (CNT < PSNAM1.0) | (CNT = PSNAM1.0)                                   
    PSNI = STRIP(PSNAM1.CNT)                                                   
    PSNO = STRIP(PSNAM2.CNT)                                                   
    CDSN = "'"PSNI"'"                                                           
    IDSN = "'"PSNI"'"                                                           
    ODSN = "'"PSNO"'"                                                           
    IF SYSDSN(CDSN) <> 'OK'                                                     
    then                                                                       
    do                                                                         
      Say "DATASET "PSNI" NOT FOUND!!"                                         
      CNT = CNT + 1                                                             
      Iterate                                                                   
    end                                                                         
    ADDRESS TSO                                                                 
    "ALLOC DA("ODSN") LIKE("IDSN") NEW"                                         
    IF RC > 0                                                                   
    then                                                                       
    do                                                                         
    say "Allocation failed for dataset: " PSNO                                 
    CNT = CNT + 1                                                               
    iterate                                                                     
    end                                                                         
    ADDRESS TSO 'ALLOC FI(INDDN) DA('IDSN') SHR KEEP'                           
    ADDRESS TSO 'ALLOC FI(ODDN) DA('ODSN') SHR KEEP'                           
    ADDRESS TSO 'EXECIO * DISKR INDDN(STEM RECS. FINIS)'                       
    ADDRESS TSO 'FREE F(INDDN)'                                                 
    'EXECIO' RECS.0 'DISKW' ODDN '(STEM RECS. FINIS)'                           
    SAY 'FILE 'PSNI' COPIED TO 'PSNO' SUCCESSFULLY'                             
    CPCNT = CPCNT + 1                                                           
    ADDRESS TSO 'FREE F(ODDN)'                                                 
    CNT = CNT + 1                                                               
END                                                                             
SAY CPCNT' files copied.'                                                       
EXIT


There is LIKE keyword in Rexx also.....This code is not working for tape.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Jul 25, 2006 11:26 pm    Post subject: Re: Copying dataset to new dataset using rexx?
Reply with quote

So, your code appears to be a REXX exec with REXX, ISPF, and TSO commands inter-mixed.

The one line that appears to be relevant is the TSO command:

"ALLOC DA("ODSN") LIKE("IDSN") NEW"

If you use the Help on the TSO ALLOCATE command (TSO HELP ALLOCATE), you will find that you can specify a UNIT(XXX) parameter, as well as other parameters such as LABEL(XXX) and VOLUME(XXX).

When I attempt something like what you are doing, I get the error:

IKJ56221I VOLUME NECESSARY TO SATISFY YOUR REQUEST NOT ON SYSTEM, AND CANNOT BE MOUNTED

since, as I mentioned previously, I don't have MOUNT authority under TSO.
Back to top
View user's profile Send private message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Mon Jun 22, 2009 8:48 pm    Post subject: Reply to: Copying dataset to new dataset using rexx?
Reply with quote

hi,

Even i was trying to create a similar tool, but the problem i am facing is with the keyword 'LIKE'.

If the dataset to be copied is a multiple volume dataset then by using the
LIKE parameter i am not able to create the file in multiple volumes.

Hence If the file size is huge, i wont be able to copy as it fails because of
insufficient space.

Could anyone please let me know how can i cerate a multiple volume dataset in REXX.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 22, 2009 9:24 pm    Post subject:
Reply with quote

Hello,

You have replied to a topic that has been inactive for 3 years. . .

REXX is probably the worst alternative for copying large files.

Suggest you simply use your sort product to copy the tape data to dasd - your sort product will perform much better than idcams/repro, iebgener, or most other utilities.

One reasonable alternative would be to have the rexx submit the proper jcl via the internal reader. . .
Back to top
View user's profile Send private message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Mon Jun 22, 2009 9:51 pm    Post subject:
Reply with quote

hi Dick,

I am not trying to copy, i just want to create the VSAM file takin the model dataset as its input.

If the model dataset is multiple volume dataset , then using 'LIKE' parameter i am not able to create multiple volume dataset.

After creating the file i will invoke IDCAMS to copy the file. So if the dataset created is not like the model dataset the IDCAMS job will fail with insufficient space.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Mon Jun 22, 2009 10:04 pm    Post subject:
Reply with quote

normally, the define parms are contained in a PDS so that a standard JOB can always delete/define a VSAM DS properly. to circumvent creating of such a library is IMUO short-sighted;having to rely on an existing vsam file to generate define parms limits the site's ability to perform many of its tasks.

I think it would be better to spend the time developing a tool that would/could access some cross reference file/database that would point to the member containing the necessary control cards - the control cards could then be modified when necessary - and simply generate JCL that would use the proper control cards. What if all copies of the vsam ds are deleted - how would your tool work then?
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2038
Location: Silicon Valley

PostPosted: Tue Jun 23, 2009 5:35 am    Post subject: Reply to: Copying dataset to new dataset using rexx?
Reply with quote

This is my rexx routine to copy datasets. It calls IEBCOPY instead of using EXECIO to read / write:
Code:
/* REXX */                                               
parse upper arg indsn outdsn rest                       
Address TSO                                             
call new_dsn                                             
"ALLOC F(IEBCPYIN) DSN("indsn")     SHR REU"             
"ALLOC F(IEBCPYOT) DSN("outdsn")    SHR REU"             
"ALLOC F(SYSUT3)   SPACE(10,20) CYL NEW REU"             
"ALLOC F(SYSUT4)   SPACE(10,20) CYL NEW REU"             
"ALLOC FILE(SYSPRINT) BLKSIZE(2660) LRECL(133) NEW REU",
            " SPACE(1,1) TRACK RECFM(F,B) "             
"ALLOC FILE(SYSIN) BLKSIZE(3280) LRECL(80)  NEW REU",   
            " SPACE(1,1) TRACK RECFM(F,B) "             
output.0 = 1                                             
output.1 = " COPY INDD=IEBCPYIN,OUTDD=IEBCPYOT"         
"EXECIO " output.0 " DISKW SYSIN ( FINIS  STEM OUTPUT." 
                                                         
"CALL 'SYS1.LINKLIB(IEBCOPY)'"                           
If rc \= '0' Then                                       
  Do                                                     
    Address ISPEXEC                                     
    "LMINIT DATAID(DATAID) DDNAME(SYSPRINT)"             
    "VIEW DATAID(&DATAID)"                               
    "LMFREE DATAID(&DATAID)"                             
  End                                                   
Address TSO                                             
"FREE  F(IEBCPYIN,IEBCPYOT)"                             
"FREE  F(SYSUT3,SYSUT4,SYSPRINT,SYSIN)"                 
                                                         
return           

new_dsn:                                                 
parse var rest 'VOL(' volume ')'                         
If volume ¬= '' then                                     
  vol = "VOLUME("volume")"                               
Else                                                     
  vol = " "                                               
lrc = listdsi(outdsn)                                     
If lrc > 0 Then                                           
  Do /* allocate new */                                   
    "ALLOC FILE(IEBCPYOT) DSN("OUTDSN") LIKE("INDSN")" vol
  End                                                     
return


Though it does not really help you with your tape dataset.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Jun 23, 2009 8:08 am    Post subject:
Reply with quote

Hi Pedro,

are we talking about copying PS or PDS files ?


Gerry
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2038
Location: Silicon Valley

PostPosted: Tue Jun 23, 2009 6:32 pm    Post subject: Reply to: Copying dataset to new dataset using rexx?
Reply with quote

Doh!

You would use IEBCOPY for PDSs or IEBGENER for sequential datasets.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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