Posted: Mon Aug 16, 2004 3:50 am Post subject: copy command for VB files in REXX
Hi,
I'm using the following TSO command to copy one data set to another
with in a Rexx Program.
Address "TSO" "COPY" pdstext temp_pds
where pdstext is the source and temp_pds is the destination
When both are FB files, its working fine. when I try to execute the same with source as VB and destination also VB(variable length), I'm encoutering the following error...
COPY TERMINATED, RENUMBERING ERROR+
RECORD LENGTH SHORTER THAN LINE NUMBER FIELD LENGTH
I'm not able to solve the p'lem even if I use RENUM option in COPY command.
Kris, since "COPY" is not a standard TSO command, it may be difficult for the members of this forum to assist.
Have you considered using another method? REPRO is the command usually invoked to copy files, or, alternatively, calling the IEBGENER or SORT programs also works well.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Aug 19, 2004 12:37 pm Post subject:
Mike,
I agree with superk , that COPY is not a standard TSO command. It is a clist. Here is the code
Code:
PROC 2 INDATASET OUTDATASET +
RENUM() NUM() NONUM NUM2() LRECL() BLOCK() +
RECFM() ASCII LIST
IF &LIST EQ LIST THEN +
CONTROL LIST SYMLIST CONLIST
/* */
SET BLANK EQ &STR( )
IF &RENUM NE &BLANK THEN SET ©STR EQ &STR(RENUM(&RENUM))
IF &NUM NE &BLANK THEN SET ©STR EQ &STR(©STR NUM(&NUM))
ELSE SET ©STR EQ &STR(©STR NONUM)
IF &NUM2 NE &BLANK THEN SET ©STR EQ &STR(©STR NUM2(&NUM2))
IF &LRECL NE &BLANK THEN SET ©STR EQ &STR(©STR LRECL(&LRECL))
IF &BLOCK NE &BLANK THEN SET ©STR EQ &STR(©STR BLOCK(&BLOCK))
IF &RECFM NE &BLANK THEN SET ©STR EQ &STR(©STR RECFM(&RECFM))
IF &ASCII EQ ASCII THEN SET ©STR EQ &STR(©STR ASCII)
IKJEBCY1 &INDATASET &OUTDATASET ©STR
FREE DSN(&INDATASET &OUTDATASET)
END
The Help for this command is
Code:
FUNCTION-
THE COPY COMMAND IS USED TO DUPLICATE A SEQUENTIAL OR
PARTITIONED DATA SET OR A MEMBER OF A PARTITIONED DATA
SET, TO ADD A MEMBER TO AN EXISTING PARTITIONED DATA SET,
OR TO MERGE TWO PARTITIONED DATA SETS.
NUM2('BEGIN COLUMN FIELD LENGTH')
LRECL(RECORDSIZE) BLOCK(BLOCKSIZE)
RECFM(U/V/F/D)
ASCII
NOTE - U MAY BE FOLLOWED BY T.
V MAY BE FOLLOWED BY B/T/BT.
F MAY BE FOLLOWED BY B/S/T/BS/BT/ST/BST.
D MAY BE FOLLOWED BY B/BA.
F V OR U MAY BE FOLLOWED BY AN A OR M.
REQUIRED - 'DSNAME1' AND 'DSNAME2'
DEFAULTS - NONUM
OPERANDS-
'DSNAME1'- THE DATA SET TO BE COPIED.
'DSNAME2'- THE EXISTING OR NEW DATA SET WHICH IS TO RECEIVE
THE COPY.
LRECL(RECORDSIZE)
- RECORDSIZE SPECIFIES THE MAXIMUM LENGTH IN BYTES OF A
LOGICAL RECORD FOR DSNAME2.
BLOCK(BLOCKSIZE)
- BLOCKSIZE SPECIFIES THE BLOCKSIZE IN BYTES THAT YOU WANT
TO USE FOR 'DSNAME2'.
RENUM('BEGIN INTEGER INCREMENT')
- THE DATA SET IS TO BE RENUMBERED. 'BEGIN INTEGER' IS THE
LINE NUMBER OF THE FIRST LINE. 'INCREMENT' IS THE AMOUNT
EACH LINE NUMBER IS TO BE INCREASED.
NUM('BEGIN COLUMN FIELD LENGTH')
- NUM INDICATES THE POSITION OF THE LINE NUMBER FIELD WITHIN
A RECORD FOR DSNAME1. 'BEGIN COLUMN' SPECIFIES THE
BEGINNING COLUMN OF THE LINE NUMBER FIELD. 'FIELD LENGTH'
SPECIFIES THE LENGTH OF THE LINE NUMBER FIELD.
NONUM
- NONUM INDICATES THAT DATASET 'DSNAME1' HAS NO
LINE NUMBER FIELD.
NUM2('BEGIN COLUMN INCREMENT')
- NUM2 INDICATES THE POSITION OF THE LINE NUMBER FIELD WITHIN
A RECORD FOR DSNAME2. 'BEGIN COLUMN' SPECIFIES THE
BEGINNING COLUMN OF THE LINE NUMBER FIELD. 'FIELD LENGTH'
SPECIFIES THE LENGTH OF THE LINE NUMBER FIELD.
RECFM(U/V/F)
- RECFM IS USED TO SPECIFY THE CHARACTERISTICS OF DATA SET
RECORDS. U,V,F,OR D MAY BE SPECIFIED, INDICATING THAT
RECORDS ARE UNDEFINED, VARIABLE, FIXED LENGTH OR
VARIABLE ASCII. IN ADDITION U,V,F,OR D MAY BE FOLLOWED
BY B,S,T,A OR M INDICATING THAT RECORDS ARE WRITTEN IN
FIXED BLOCKS, STANDARD BLOCKS, USING THE TRACK OVERFLOW
FEATURE OR HAVE ASCII OR MACHINE CONTROL CHARACTERS.
VALID COMBINATIONS ARE AS FOLLOWS: UT,VB,VT,VBT,DB,DA,
DBA,FB,FS,FT,FBS,FBT,FST,FBST.
ASCII
- ASCII SPECIFIES THAT TRANSLATION TO ASCII IS TO
BE PERFORMED.
I typed TSO HELP for a list of all commands and came up with the following:
<snip>
DATA MANAGEMENT COMMANDS:
ALLOCATE ALLOCATE A DATA SET WITH OR WITHOUT AN ATTRIBUTE
LIST OF DCB PARAMETERS.
ALTLIB DEFINE OPTIONAL, USER-LEVEL OR APPLICATION-LEVEL SETS OF
LIBRARIES CONTAINING SAA/PL EXECS OR CLISTS. THESE
LIBRARIES ARE SEARCHED WHEN IMPLICITLY INVOKING AN
SAA/PL EXEC OR CLIST.
ATTRIB ALLOW DCB PARAMETERS TO BE DYNAMICALLY INTRODUCED
AND NAMED FOR USE WITH A SUBSEQUENT ALLOCATE COMMAND.
CONVERT SIFT ITF/PL1 AND FORTRAN SOURCE.
COPY COPY A DATA SET. (SEE NOTE BELOW.)
DELETE DELETE A DATA SET.
EDIT CREATE, EDIT, AND/OR EXECUTE A DATA SET.
FORMAT FORMAT AND PRINT A TEXT DATA SET. (SEE NOTE BELOW.)
FREE RELEASE A DATA SET AND/OR AN ATTRIBUTE LIST.
LIST DISPLAY A DATA SET. (SEE NOTE BELOW.)
LISTALC DISPLAY ACTIVE DATA SETS.
LISTBC DISPLAY MESSAGES FROM OPERATOR/USER.
LISTCAT DISPLAY USER CATALOGUED DATA SETS.
LISTDS DISPLAY DATA SET ATTRIBUTES.
MERGE COMBINE DATA SETS. (SEE NOTE BELOW).
PRINTDS PRINT A DATA SET.
PROTECT PASSWORD PROTECT DATA SETS.
RENAME RENAME A DATA SET.
TSOLIB DEFINE OPTIONAL SEARCH LEVEL THAT TSO/E USES WHEN SEARCHING
FOR COMMANDS AND PROGRAMS.
NOTE: THE TSO DATA UTILITY COMMANDS, COPY, FORMAT, LIST AND MERGE,
ARE PART OF PROGRAM PRODUCT 5734-UT1. THIS PRODUCT MUST BE
INSTALLED PRIOR TO UTILIZING THE COMMANDS AND RELATED HELPS.
<snip>
Note the bits about the copy command. _________________ My opinions are exactly that.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum