Hello
I am a newbie here and I have just started learning Rexx. I need help to execute a rexx program.
I have coded rexx program to copy the existing vsam file to a new vsam file with the same attributes of existing one. I agree file-aid can do the same functionality. I wanted to give a try.
The error is shown below:
30 *-* "DEFINE CLUSTER (NAME("'ODSN'") MODEL("'VDSN'")),
DATA (NAME("'ODSNDAT'"))"
>>> "DEFINE CLUSTER (NAME(ODSN) MODEL(VDSN)),
DATA (NAME(ODSNDAT))"
IGD01008I SC SET TO SCSHTEST
IGD01005I SC SET TO SCSHTEST
IGD01009I MC SET TO MCTSHORT, EXPIRES AFTER 30 DAYS OF NON USAGE
IDC3901I ERROR QUALIFYING A123.VDSN
IDC3902I ** DEFAULT SERVICE ROUTINE ERROR CODE 20, LOCATE ERROR CODE 8
IDC0014I LASTCC=12
Rexx code :
/* REXX */
"ISPEXEC CONTROL ERRORS RETURN"
ADDRESS ISREDIT 'MACRO'
IF RC = 0 THEN
ADDRESS ISREDIT "(VDSN) = VSAMFILE"
VAR1 = VDSN
ODSN = 'TEST.VSAM.FILE1'
ODSNDAT = 'TEST.VSAM.FILE1.DATA'
DSINFO = LISTDSI(VAR1)
IF SYSDSORG = 'VS' THEN
IF RC = 0 THEN
SAY 'VSAM FILE - ALLOC CLUSTER NOW'
ELSE
SAY 'NOT A VSAM FILE'
/* ALLOCATE FILE */
IF SYSDSN(ODSN) = 'OK' THEN
DO
IF SYSVAR(SYSISPF) \= 'ACTIVE' THEN
DO
SAY 'DATASET ' ODSN ' CATALOGED. INITIATING COPY'
END
END
DO
"DEFINE CLUSTER (NAME("'ODSN'") MODEL("'VDSN'")),
DATA (NAME("'ODSNDAT'"))"
IF RC > 0 THEN
SAY 'DEFINE CLUSTER FAILED FOR' VDSN
ELSE
DO
"REPRO INDATASET("'VDSN'") OUTDATASET("'ODSN'") REPLACE"
IF RC = 0 THEN
SAY ' VSAM FILE COPY SUCCESSFUL'
END
END
The error is due to the file preceding with my id A123. Toavoid this , I have actually given quotes to the file. Even then , I got the same error.
Please let me know how I can fix this..