Page 1 of 2
LISTC clarification
Posted:
Thu May 17, 2012 10:47 pm
by Viswanathchandru
Dear all,
I have a piece of snipet that list the catalog information of a GDG generation file. The code works fine if i give the GDG file inside the code. But, if i fetch the GDG file names from a different dataset through EXECIO command it fails with RC 12. Can anYbodY help me in understanding the reason. Please find the codes below:
X=OUTTRAP('LST.')
"LISTC ENT('"REWIEW.GDG.G0201V00 "') ALL"
X=OUTTRAP=('OFF')
this works fine. But this code
/* REXX */
TRACE ?R
"ALLOC F(INDD) DS('"REVIEW.DATASET.REPORT"') SHR REUSE"
"EXECIO * DISKR INDD(STEM NEW."
DO I=1 TO NEW.0
X=OUTTRAP('LST.',4)
"LISTC ENT('"NEW.I"') ALL"
X=OUTTRAP=('OFF')
where REVIEW.DATASET.REPORT contains 5 GDG's together. Please advice. Apologize if i'm wrong!
Regards,
Viswa
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:03 pm
by dick scherrer
Hello,
Inside the DO loop, where did you specify the dataset name for the listc? It is allocated, but i don't see this referenced in the other code. . .
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:06 pm
by Viswanathchandru
Hello scherrer,
Thanks for addressing the post!. The dataset name is obtained from the stem variable.
Regards,
Viswa
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:09 pm
by steve-myers
If you look at the contents of REVIEW.DATASET.REPORT you should be able to deduce the problem quite quickly.
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:13 pm
by Pedro
Show us the trace.
Likely, you need to strip out trailing blanks.
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:15 pm
by Viswanathchandru
Hello Steve, here is the Trace.
4 *-* "EXECIO * DISKR INDD(STEM NEW."
>>> "EXECIO * DISKR INDD(STEM NEW."
5 *-* DO I=1 TO NEW.0
>>> "1"
>>> "2"
6 *-* X=OUTTRAP('LST.',4)
>>> "LST."
7 *-* "LISTC ENT('"NEW.I"') ALL"
>>> "LISTC ENT(' REWIEW.GDG.G0201V00
') ALL"
+++ RC(12) +++
Regards,
Viswa
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:24 pm
by Akatsukami
Pedro wrote:Show us the trace.
Likely, you need to strip out trailing blanks.
And leading ones, evidently.
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:31 pm
by Viswanathchandru
Akatsukami, Pedro, steve, Thanks for addressing the post!
As advised i have manually deleted the space i mean the leading ones. Still i get the same. here is the trace.
7 *-* "LISTC ENT('"NEW.I"') ALL"
>>> "LISTC ENT('REVIEW.GDG.G0201V00
') ALL"
+++ RC(12) +++
please advice.
Regards,
Viswa
Re: LISTC clarification
Posted:
Thu May 17, 2012 11:55 pm
by BillyBoyo
It seems you have trailing spaces, as previously suggested. If you strip those away, it'll all fit on one line as well.
Re: LISTC clarification
Posted:
Fri May 18, 2012 12:01 am
by Viswanathchandru
Perfect from all! trailing spaces made the problem. Which i didnt notice. i tried leading. but left trailing. Now it works fine. Thanks Scherrer, Pedro,Akatsukami, Steve,Bill for the guidance and support. Thanks again!
Regards,
Viswa