IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem running REXX(LISTDSI) from JCL


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
graswant

New User


Joined: 29 Apr 2006
Posts: 93
Location: Singapore

PostPosted: Mon Nov 10, 2008 7:19 pm
Reply with quote

Hi
I am new to REXX and I have been trying to write a Rexx which will check if a Dataset is existing in a perticular volume.. it will use inputfile which will have list of Datasets and volumes...Rexx just needs to check if the dataset is in the volume listed infront of it and put a msg if it exists in that volume or now... If I just use EX and run REXX it works fine but when I submit it through JCL ...LISTDSI gives me return code 16...and I have been trying to figure out what exactly is going wrong but not able to... the REXX and JCL which I have written is listed below.. can someone please help me out with this...
Code:

/* REXX */
"EXECIO * DISKR  FILEIN (FINIS STEM LINE."
DO X=1 TO 100
    STNG = SUBSTR(LINE.X,30,30)
    VLSR = SUBSTR(LINE.X,12,10)
    VOLM = SUBWORD(LINE.X,2,1)
    DDNM = SUBSTR(LINE.X,2,10)
    ARGM = "VOLUME("VOLM")"
  RC = LISTDSI(STNG ARGM)
      IF RC = 0 THEN DO
           OUT.X = DDNM VLSR STNG 'OK'
      END
      ELSE DO
            OUT.X = DDNM VLSR STNG 'NOT OK'
      END
END
"EXECIO * DISKW  FILEOUT (FINIS STEM OUT."


The input file have lot of details so I have to use SUBSTR and SUBWORD to get what I want.

Code:

//DELETE  EXEC  PGM=IDCAMS
//SYSPRINT  DD  SYSOUT=*
//SYSIN     DD  *
              DELETE OUTPUT.OUTPUT.OUTFILE
              SET MAXCC=0
/*
//IKJEFT01    EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K
//SYSEXEC   DD DSN=ABCDEF.GHIJK.LMNOP,DISP=SHR
//FILEIN       DD DSN=INPUT.INPUT.FILE,DISP=SHR
//FILEOUT    DD DSN=OUTPUT.OUTPUT.OUTFILE,DISP=(,CATLG),
//                SPACE=(CYL,(5,5),RLSE),
//                RECFM=FB,LRECL=80,BLKSIZE=0
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
         %RXXDSVL


If I use ALLOC and run REXX alone...it works fine and give me required output in the FILEOUT....but when I run it through JCL...LISTDSI gives Return code 16 and gives wrong output....

Can someone please suggest what needs to be done....

Thanks and Regards
Gaurav
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Nov 10, 2008 7:37 pm
Reply with quote

Hmmm. Worked OK for me either way if I used the exact same input data format.

Can you post a runtime TRACE output?
Back to top
View user's profile Send private message
graswant

New User


Joined: 29 Apr 2006
Posts: 93
Location: Singapore

PostPosted: Mon Nov 10, 2008 7:48 pm
Reply with quote

Here we go...

Code:

25 *-*  RC = LISTDSI(STNG ARGM)
       >V>    "ABJ.H09F210.AABJCLST          "
       >V>    "VOLUME(ZAARED)"
       >O>    "ABJ.H09F210.AABJCLST           VOLUME(ZAARED)"
       >F>    "16"
    26 *-*  IF RC = 0
       >V>    "16"
       >L>    "0"
       >O>    "0"
    32 *-*  ELSE
       *-*   DO


well this is the part of the function which gives 16 as reason code...and JCL finishes ok..with MAX CC=0 and no other error msg from REXX..... the rest of the TRACE is the details of other steps which went ok...
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Nov 10, 2008 7:52 pm
Reply with quote

Where are the quotes around the dataset name?

That should be 'ABJ.H09F210.AABJCLST' in order for LISTDSI to work.
Back to top
View user's profile Send private message
graswant

New User


Joined: 29 Apr 2006
Posts: 93
Location: Singapore

PostPosted: Mon Nov 10, 2008 7:55 pm
Reply with quote

Thanks for the reply...

What changes should I make...coz what ever I put...it makes them comments

RC = LISTDSI('''||STNG||''' ARGM)

Will it work...

thanks and Regards
Gaurav
Back to top
View user's profile Send private message
graswant

New User


Joined: 29 Apr 2006
Posts: 93
Location: Singapore

PostPosted: Mon Nov 10, 2008 7:58 pm
Reply with quote

I have tried many possibilities...but non or them gives me the output...

Code:

 25 *-*  RC = LISTDSI("'"||STNG||"'" ARGM)
       >L>    "'"
       >V>    "ABJ.H09F210.AABJCLST          "
       >O>    "'ABJ.H09F210.AABJCLST          "
       >L>    "'"
       >O>    "'ABJ.H09F210.AABJCLST          '"
       >V>    "VOLUME(ZAARED)"
       >O>    "'ABJ.H09F210.AABJCLST          ' VOLUME(ZAARED)"
IKJ56709I INVALID DATA SET NAME, 'ABJ.H09F210.AABJCLST
IKJ56709I INVALID DATA SET NAME, '
       >F>    "16"
    26 *-*  IF RC = 0
       >V>    "16"
       >L>    "0"
       >O>    "0"
 


everything gives me INVALID DATA SET NAME
Back to top
View user's profile Send private message
graswant

New User


Joined: 29 Apr 2006
Posts: 93
Location: Singapore

PostPosted: Mon Nov 10, 2008 8:08 pm
Reply with quote

ONe more question...If there should be quotes around the dataset name...then how come the REXX works fine independently....but when I run it through JCL...it gives this problem....is there some difference ????
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Nov 10, 2008 8:12 pm
Reply with quote

Does the input dataset contain fully-qualified dataset names? For the purposes of my test, I assumed that a dataset name would be listed in the data in the fully-qualified format of 'ABJ.H09F210.AABJCLST' with no leading or trailing blanks.
Back to top
View user's profile Send private message
graswant

New User


Joined: 29 Apr 2006
Posts: 93
Location: Singapore

PostPosted: Mon Nov 10, 2008 8:19 pm
Reply with quote

Hi Superk

you know what.... you are great man.... yes there were blanks...as I was giving a buffer gap as the input file had Datasets with different length... I changes the REXX and used SUBWORD instead of SUBSTR...and it worked....
Thanks a lot for your help...

thanks and Regards
Gaurav...
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Nov 10, 2008 10:02 pm
Reply with quote

It probably works in TSO because you have setup your prefix. If you do not use quotes, it adds you prefix in front of the dataset name.

But it does not do it for you in batch TSO. Use the profile command to set it:
Code:
//SYSTSIN   DD *
  profile prefix(abj)
         %RXXDSVL
Back to top
View user's profile Send private message
graswant

New User


Joined: 29 Apr 2006
Posts: 93
Location: Singapore

PostPosted: Tue Nov 11, 2008 11:48 am
Reply with quote

Hi Pedro

Thanks for the information... things are working now...thanks a lot...

Thanks and Regards
Gaurav
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top