Page 2 of 2

Re: Information About the Migrated datasets

PostPosted: Wed Sep 12, 2012 8:26 pm
by balamurali cl
Hi All,

I used OUTRAP to capture the output but the OUTRAP is not capturing the data

/* REXX */                               
SAY "ENTER HLQ"                         
PARSE UPPER PULL DSN1                   
ADDRESS TSO                             
X = OUTTRAP('VAR.')                     
"HLIST DSNAME('"DSN1"') BCDS"           
SAY 'THE NO OF LINES TRAPPED IS' VAR.0   
LINES = VAR.0 + 1                       
DO I=LINES TO VAR.0                     
   SAY VAR.I                             
END                                     
X = OUTTRAP('OFF')                       
IF RC > 0 THEN                           
   SAY 'YOUR O/P IS WRITTEN'             
ELSE                                     
   SAY 'SORRY SOME ERROR HAS OCCURED' RC
EXIT                                     


Please let me knwo if corrections required or cant we capture the data of HLIST commands using OUTTRAP?

Re: Information About the Migrated datasets

PostPosted: Wed Sep 12, 2012 8:36 pm
by balamurali cl
Hi Robert,

Really thanks for ur great information..!!!!

here I am creating the file with my user id (HLQ) only. So I canged code as you have mentioned. I am not getting the dataset allocation error.

However I the dataset is empty. It doesnot have the required data.

Please see the code belwo and correct me
/* REXX */                                         
DUH_USER = USERID()                                 
DSN=DUH_USER'.ITEMS.LIST'                           
Y = DSNCKC(DSN)                                     
ADDRESS TSO                                         
"ALLOC F(OUT) DA('"DSN"') NEW TRACKS SPA(60 45) " ,
" LRECL(80) RECFM(F B) BLKSIZE(9040) DSORG(PS)"     
IF RC > 0 THEN                                     
  DO                                               
    SAY 'ALLOCATION FAILED RC=:' RC                 
    ADDRESS TSO 'FREE F(OUT)'                       
    EXIT                                           
  END                                               
SAY "ENTER HLQ"                                     
PARSE UPPER PULL DSN1                               
ADDRESS TSO                                         
"HLIST DSNAME('"DSN1"') BCDS ODS(ND2659A.DSN)"     
SAY ND2659A.DSN                                     
EXIT                                               
DSNCKC: PROCEDURE                                   
        PARSE ARG DSN                               
        DSN = "'"DSN"'"                             
        ADDRESS TSO                                 
        X = SYSDSN(DSN)                             
        IF X ¬= 'OK' THEN RETURN DSN               
        ELSE                                       
           DO                                       
             ADDRESS TSO DELETE DSN                 
             IF RC = 0 THEN SAY 'DELETED'           
             ELSE SAY 'NOT DELETED'                 
             RETURN DSN                             
           END                                     


Please correct me !!!!!!!!!!!!!!!!!!!!!!!

Re: Information About the Migrated datasets

PostPosted: Wed Sep 12, 2012 9:21 pm
by NicC
LINES = VAR.0 + 1                       
DO I=LINES TO VAR.0


say var.0 is 20. the first line above sets lines to 21. You then try to do i = 21 to 20. No wonder you appear to have no output - your loop is never entered.as your TO value has to be greater than your FROM value unless you are doing BY -1

Re: Information About the Migrated datasets

PostPosted: Thu Sep 13, 2012 7:40 pm
by balamurali cl
Hi ,

I changed the code but the OUTRAP is not capturing the output
ADDRESS TSO                             
X = OUTTRAP('VAR.')                     
"HLIST DSNAME('"DSN1"') BCDS"           
SAY 'THE NO OF LINES TRAPPED IS' VAR.0 
LINES = VAR.0 + 1                       
DO I=1 TO LINES                         
   SAY 'IN LOOP'                       
   SAY I                               
   SAY VAR.I                           
   I = I + 1                           
END                                     
X = OUTTRAP('OFF')                     


Please let me know if we have any alternative?

I have tried using the ODS(a.dsn name)

where is 'a' is my user id. But still the RACF accees error is hown.

I need the data i am getting when i execute the HLIST command?

Re: Information About the Migrated datasets

PostPosted: Thu Sep 13, 2012 8:49 pm
by Akatsukami
balamurali cl wrote:Hi ,

I changed the code but the OUTRAP is not capturing the output
ADDRESS TSO                             
X = OUTTRAP('VAR.')                     
"HLIST DSNAME('"DSN1"') BCDS"           
SAY 'THE NO OF LINES TRAPPED IS' VAR.0 
LINES = VAR.0 + 1                       
DO I=1 TO LINES                         
   SAY 'IN LOOP'                       
   SAY I                               
   SAY VAR.I                           
   I = I + 1                           
END                                     
X = OUTTRAP('OFF')                     


Please let me know if we have any alternative?

I have tried using the ODS(a.dsn name)

where is 'a' is my user id. But still the RACF accees error is hown.

I need the data i am getting when i execute the HLIST command?

Read about the OUTDATASET parameter of the LIST command in the fine manual. Incidentally, unless you've changed the default environment earlier, ADDRESS TSO is a wombat; if you have changed, you probably shouldn't have.

Re: Information About the Migrated datasets

PostPosted: Thu Sep 13, 2012 9:11 pm
by NicC
What does var.0 show when you trace it? Why are you looping through MORE lines than you have (var.0 + 1)? Why are you incrementing I twice - once in the DO statement and once explicitly in I = I + 1? why are you not doing it simply:
Do i = 1 to var.0
   Say var.i
End


And what is
accees error is hown
? I presume 'accees' is a typo for 'access' but 'hown'? If you mean 'thrown' you are wrong - things are not 'thrown' on a mainframe: they are displayed, subbed, issued whatever but never 'thrown'.

Re: Information About the Migrated datasets

PostPosted: Thu Sep 13, 2012 11:39 pm
by dick scherrer
but 'hown'
Shown?

Re: Information About the Migrated datasets

PostPosted: Fri Sep 14, 2012 1:19 pm
by NicC
Ah - yes. The missing 'S' syndrome. I had one in that post as well - corrected now.