Error in rexx code execution



IBM's Command List programming language & Restructured Extended Executor

Error in rexx code execution

Postby devi » Wed Jan 26, 2011 7:11 pm

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..
devi
 
Posts: 1
Joined: Wed Jan 26, 2011 6:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Error in rexx code execution

 

Re: Error in rexx code execution

Postby prino » Wed Jan 26, 2011 7:50 pm

You learn something every day, never knew about the existence of

ADDRESS ISREDIT "(VDSN) = VSAMFILE"
...

Suggest you start reading manuals before you post!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: Error in rexx code execution

Postby MrSpock » Wed Jan 26, 2011 9:57 pm

I was curious why this code is written as a quasi-ISPF Edit Macro (I don't see any actual EDIT Macro commands). Anyway, once you address Robert's comment, it would be nice to see a full runtime TRACE posted.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Error in rexx code execution

Postby Pedro » Thu Jan 27, 2011 2:49 am

ADDRESS ISREDIT "(VDSN) = VSAMFILE"


Are you a time traveler from the future, where editing a VSAM file is supported?
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: Error in rexx code execution

Postby NicC » Thu Jan 27, 2011 11:06 am

Given the fact that TS states "just started learning Rexx" we should cut SOME slack. Looks like s/he is starting off by writing an ISPF edit macro - probably not the best place to start but ... hey!

Next thing is that Rexx does not 'do' VSAM unless you have a nifty bit of assembler code - RXVSAM. However, the copy is being attempted using REPRO. Now, this is an IDCAMS command and I do not know if it can be used stand-alone. If it can, then I have added another bit of knowledge today.

Methinks that this is not the full macro but that it has been hacked down for the posting, otherwise why all the unnecessary DOs and ENDs? Also the error messge identifis A123.VDS as the dataset it is trying to allocate - what happened to the value in ODSN?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Error in rexx code execution

Postby mongan » Thu Jan 27, 2011 12:29 pm

First, you should have taken a good look at the error messages. You could use the internet function provided by IBM, Lookat.
http://www-1.ibm.com/servers/eserver/zs ... ookat.html

If you would have examined the error messages you would have found out that the data set is not cataloged, and it tells you which one.
A123.VDSN. This is supposed to be a model for your define. You probably missed that you do not have a model A123.VDSN, but you might have a VDSN model. I assume that the problem is that your userid is prefixed to your VDSN. Besides that, I take it that VDSN has not been supplied with a real name for the model. This should get you started in the right direction.
User avatar
mongan
 
Posts: 212
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post