LISTC clarification



IBM's Command List programming language & Restructured Extended Executor

LISTC clarification

Postby Viswanathchandru » Thu May 17, 2012 10:47 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: LISTC clarification

Postby dick scherrer » Thu May 17, 2012 11:03 pm

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: LISTC clarification

Postby Viswanathchandru » Thu May 17, 2012 11:06 pm

Hello scherrer,

Thanks for addressing the post!. The dataset name is obtained from the stem variable.

Regards,
Viswa
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: LISTC clarification

Postby steve-myers » Thu May 17, 2012 11:09 pm

If you look at the contents of REVIEW.DATASET.REPORT you should be able to deduce the problem quite quickly.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: LISTC clarification

Postby Pedro » Thu May 17, 2012 11:13 pm

Show us the trace.

Likely, you need to strip out trailing blanks.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: LISTC clarification

Postby Viswanathchandru » Thu May 17, 2012 11:15 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: LISTC clarification

Postby Akatsukami » Thu May 17, 2012 11:24 pm

Pedro wrote:Show us the trace.

Likely, you need to strip out trailing blanks.

And leading ones, evidently.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: LISTC clarification

Postby Viswanathchandru » Thu May 17, 2012 11:31 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: LISTC clarification

Postby BillyBoyo » Thu May 17, 2012 11:55 pm

It seems you have trailing spaces, as previously suggested. If you strip those away, it'll all fit on one line as well.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: LISTC clarification

Postby Viswanathchandru » Fri May 18, 2012 12:01 am

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post