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

Getting RC = 20 from "EXECIO "QUEUED()" DISK


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

New User


Joined: 14 Oct 2006
Posts: 14
Location: Appleton Wi USA

PostPosted: Sat Aug 13, 2011 1:08 am
Reply with quote

I have ONE user that is having issues with a REXX program when it issues the command "EXECIO "QUEUED()" DISKW SYSIN (FINIS" to write records that have been queued up. He gets the following message on his screen:
Code:
The input or output file SYSIN is not allocated. It cannot be opened for I/O.
EXECIO error while trying to GET or PUT a record.

I have TRACEd the REXX and can see that he is getting a RC=20 on the EXECIO command. However, other users (myself included) have no issues with this code. I have searched this forum (and others) but have not found anything that has helped me resolve this issue.

Here is a snippet of the actual code causing the issue:
Code:

IF XINQ ¬= '' & TESTDATE ¬= '' THEN DO
    QUEUE "$$DD01 COPYBACK IF=(0001,EQ,C'"XINQ"'),"
    QUEUE "               AND=(51,EQ,C'"TESTDATE"'),"
END

QUEUE "                MOVE=(001,100,017),"
QUEUE "                MOVE=(101,100,117),"
QUEUE "                MOVE=(201,100,217),"
QUEUE "                MOVE=(301,100,317),"
QUEUE "                MOVE=(401,100,417),"
QUEUE "                MOVE=(501,100,517),"
QUEUE "                MOVE=(601,100,617),"
QUEUE "                MOVE=(701,100,717),"
QUEUE "                MOVE=(801,100,817),"
QUEUE "                MOVE=(901,100,917),"
QUEUE "                MOVE=(1001,100,1017),"
QUEUE "                MOVE=(1101,021,1117),"
QUEUE "                OUT=0"

"EXECIO "QUEUED()"  DISKW SYSIN (FINIS"


Can anyone help explain what might be going on with this one user and why he might be getting different results?

Thanks for any help you can provide.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sat Aug 13, 2011 1:47 am
Reply with quote

Well, writing to a file named SYSIN is pretty darned confusing.

More to the point, however the file needs to be allocated somewhere. That's not happening for your cow-orker; it may well be happening for you in another exec or program, and SYSIN is never freed.

Assume for the sake of argument that you wish the records to be written to HLQ.FOO(BAR). Clone the exec and add
Code:
"ALLOC FI(SYSIN) DA('HLQ.FOO(BAR)') SHR"

before the EXECIO, and
Code:
"FREE FI(SYSIN)"

after it.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Aug 13, 2011 10:27 am
Reply with quote

Quote:
The input or output file SYSIN is not allocated.


This message seems pretty self-explanatory. To get more information you should issue this TSO command:
Code:
PROFILE MSGID


Then re-create the problem. It will then give you a message number that you can lookup.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Aug 13, 2011 1:59 pm
Reply with quote

I agree with Akatsukami. 99% of people looking at your code will think "what the heck is that"?

Are you using SYSIN because some other program is reading SYSIN? Or are you/whoever wrote it trying to avoid having to deal with datasetnames?

Maybe most of your ids get SYSIN allocated by default, and one doesn't, or as Akatsukami, all the other have previously used something which fails to deallocate SYSIN, except the user with the "problem".

Actually, it is the user with the "problem" who is working "correctly", everyone else is working "by accident", ie, not by relying on code in the program.

Use another filename. Allocate it. Write to it. Deallocate it. It'll work for everybody, and not rely on some "state" that most, but not all, users have when the program starts.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sat Aug 13, 2011 2:30 pm
Reply with quote

Writing to SYSIN may be unusual, but if what you're writing out is used in the same code by utility that expects SYSIN as its input dataset, it does make sense...

I have a front-end for the ISPF EDIT COMPARE command that dynamically builds the required SYSIN and it would be utterly silly to actually allocate a permanent dataset with a DDNAME SYSOUT, free it and reallocate it with a DDNAME SYSIN...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Aug 13, 2011 11:39 pm
Reply with quote

I don't know, Prino.

As SYSIN would have emerged from a card-reader originally, I'd get the "output" side would be the card punch, SYSPCH or SYSPNCH (I think the first, can't remember clearly, not going to check). Of course "device independence" means it doesn't matter, does it? Not to the computer, just to us humans. OK, actually SYSIN does get some special processing. In JCL, if you have some "cards" lying around, the system will generate a //SYSIN DD * for you. If, in batch, you happened to be writing to SYSIN as well, you'd get some confusion.

I don't know what TSO would make of it all, but it looks like for TS he is suffering/benefitting from a default assignment somewhere along the way - except for one user, who probably has a different "profile" in that he's a different type of user, or by default does something which frees it.


So, I think writing to SYSIN looks confusing. It is, after all, only a DD isn't it? So no requirement to be the same as anything subsequent?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Aug 14, 2011 3:25 pm
Reply with quote

Writing to SYSIN is not so exceptional. I do this all the time... icon_smile.gif
Here is one example:
Code:
   Address TSO                                                 
   "ALLOC F(SYSIN) NEW REUSE RECFM(F) LRECL(80)"
   Srt. = ""                                                   
   Srt.1 = "  SORT FIELDS=COPY"                                 
   Srt.2 = "  INCLUDE COND=(2,8,CH,EQ,C'"PgmName"')"           
   Srt.3 = "  SUM FIELDS=NONE"                                 
   "EXECIO * DISKW SYSIN (FINIS STEM Srt."                     
                                                               
   "ALLOC F(SYSOUT) DUMMY REUSE"                               
   "ALLOC F(SORTIN) DA('hlq.lib.lib(proglist)') SHR REUSE" 
   "ALLOC F(SORTOUT) NEW REUSE RECFM(F) LRECL(22)"                     
                                                               
   "CALL *(SYNCSORT)"                                           
                                                               
   Status. = ''                                                 
   "EXECIO 1 DISKR SORTOUT (FINIS STEM Status."                 
   "FREE F(SYSIN,SORTIN,SORTOUT,SYSOUT)"                       
   Address                                                     
I have rexx programs that run DFHCSDUP, IEBCOPY, COMPAREX, SYNCSORT and IGYCRCTL.
All of them use SYSIN !
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 15, 2011 4:24 am
Reply with quote

Maybe it is only Akatsukami and I who find it unusual to write to SYSin.

Would we read, for instance, SORTOUT. Ooops. I see we have an answer there as well.

I suppose this comes down to the difference between TSO and JCL. In JCL, the DDs do not exist beyond the step in which they are used. So, with no "convenience" in JCL of just having some DD lying around which you could pre-use or re-use, we don't do it, we give it a different DD name. We could write to SYSIN as a PS/PDS member in one step and in the next step use SYSIN with the same DSN. Same with the SORTOUT. We just don't, by convention I suppose.

Because it can be done in TSO in itself doesn't mean it should, or shouldn't.

Wandering off-topic, though, I think...
Back to top
View user's profile Send private message
mprobst

New User


Joined: 14 Oct 2006
Posts: 14
Location: Appleton Wi USA

PostPosted: Tue Aug 16, 2011 12:28 am
Reply with quote

Thank You all for your suggestions..... I finally determined what the issue was...... Akatsukami was on the right track.

Even though there was code in the CLIST to ALLOCATE and FREE the dataset in the SYSIN DD, it was not happening successfully. This was due to the fact that the user had an issue months ago and a dataset named Userid.SYSIN was left hanging on the system and eventually got migrated off to tape. So now when this CLIST tried to ALLOCATE the dataset, it was unsuccessful. For some reason the TRACE did not show a bad return code on the ALLOCATE but it showed a RC=20 on the EXECIO when trying to write to the SYSIN DD.

Once we recalled and deleted Userid.SYSIN the issues went away.

By the way... this code was written by someone else long ago.... who knows why they decided to name the DD "SYSIN".... But the DD name had no bearing on the issue.

Thanks again for all your help.
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 PuTTY - "User is not a surrogate... IBM Tools 5
No new posts CA Disk LISTD SQL CA Products 1
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
Search our Forums:

Back to Top