Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
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
References
saithvis2

Active User


Joined: 23 Dec 2005
Posts: 62
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: 3314
Location: Charlotte,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: 3314
Location: Charlotte,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: 3314
Location: Charlotte,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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1