View previous topic :: View next topic
|
Author |
Message |
aishwarya_singh
New User
Joined: 06 Apr 2005 Posts: 21
|
|
|
|
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 |
|
|
saithvis2
New User
Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
aishwarya_singh
New User
Joined: 06 Apr 2005 Posts: 21
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
aishwarya_singh
New User
Joined: 06 Apr 2005 Posts: 21
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Vinay N.G
New User
Joined: 15 Sep 2008 Posts: 36 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Vinay N.G
New User
Joined: 15 Sep 2008 Posts: 36 Location: Bangalore
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Pedro,
are we talking about copying PS or PDS files ?
Gerry |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Doh!
You would use IEBCOPY for PDSs or IEBGENER for sequential datasets. |
|
Back to top |
|
|
|