View previous topic :: View next topic
|
Author |
Message |
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Who wants to be my hero . . . ?
Over the last day or so, i have tried several different bits of code and almost all "work", but none actually write in the output datset. I have done something most simple incorrectly
I read many topics in our forum and have tried many of the "solutions". Here is one of the attempts - possibly the most simple:
Code: |
/*REXX*/
TRACE I
" ALLOC DSN("MY.DSLSI.TEST.FILE2") FI(OREC) OLD REUSE "
PUSH " SOME DATA TO BE WRITTEN"
"EXECIO 1 DISKW OREC (FINIS"
"FREE FI(OREC)" |
When executed (in batch with a pre-allocated dataset), i get this:
Code: |
4 *-* " ALLOC DSN("MY.DSLSI.TEST.FILE2") FI(OREC) OLD REUSE "
>L> " ALLOC DSN("
>L> "MY.DSLSI.TEST.FILE2"
>O> " ALLOC DSN(MY.DSLSI.TEST.FILE2"
>L> ") FI(OREC) OLD REUSE "
>O> " ALLOC DSN(MY.DSLSI.TEST.FILE2) FI(OREC) OLD REUSE "
6 *-* PUSH " SOME DATA TO BE WRITTEN"
>L> " SOME DATA TO BE WRITTEN"
7 *-* "EXECIO 1 DISKW OREC (FINIS"
>L> "EXECIO 1 DISKW OREC (FINIS"
8 *-* "FREE FI(OREC)"
>L> "FREE FI(OREC)"
READY
END |
Attempts with a stem also get the same result.
Where have i gone astray?
Thanks,
d |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
You seem not to be enclosing the DSN in single quotes. Is that correct? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Must not have been correct . . . I added the single quotes and Voila - data.
Even though i'd done the allocation in JCL, it still allocated a different dataset with my uid as the first node. D'oh. I'm a bit surprised that the full dsn was not shown in the trace . . .
Thanks!
d |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
The code very well for me except for one thing I did
I just allocated as ('" "') but in your case the dataset didnt throw any error may be because your dataset exists...
weird |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I don't know but maybe the ALLOC in your exec overrides the JCL allocation? I never use ALLOC in a batch rexx - much simpler to to it via JCL. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I'm a bit surprised that the full dsn was not shown in the trace . . . |
Adding the prefix is a TSO thing, not a rexx thing. It is all done within the processing of the ALLOC command, so there is nothing that will be captured in the trace. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thanks everyone for the replies.
I'm sure i'll be back . . .
d |
|
Back to top |
|
|
|