Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem running REXX(LISTDSI) from JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Problem running REXX(LISTDSI) from JCL
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

Moderator Team Head


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

PostPosted: Mon Nov 10, 2008 7:37 pm    Post subject: Reply to: Problem running REXX(LISTDSI) from JCL
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    Post subject: Hi
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

Moderator Team Head


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

PostPosted: Mon Nov 10, 2008 7:52 pm    Post subject: Reply to: Problem running REXX(LISTDSI) from JCL
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    Post subject: Hi
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    Post subject: Hi
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    Post subject: Hi
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

Moderator Team Head


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

PostPosted: Mon Nov 10, 2008 8:12 pm    Post subject: Reply to: Problem running REXX(LISTDSI) from JCL
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    Post subject: Hi
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

Senior Member


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

PostPosted: Mon Nov 10, 2008 10:02 pm    Post subject: Reply to: Problem running REXX(LISTDSI) from JCL
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    Post subject: Reply to: Problem running REXX(LISTDSI) from JCL
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us