Information About the Migrated datasets



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

Re: Information About the Migrated datasets

Postby balamurali cl » Wed Sep 12, 2012 8:26 pm

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?
balamurali cl
 
Posts: 36
Joined: Mon Sep 03, 2012 9:01 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Information About the Migrated datasets

Postby balamurali cl » Wed Sep 12, 2012 8:36 pm

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 !!!!!!!!!!!!!!!!!!!!!!!
balamurali cl
 
Posts: 36
Joined: Mon Sep 03, 2012 9:01 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Information About the Migrated datasets

Postby NicC » Wed Sep 12, 2012 9:21 pm

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
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Information About the Migrated datasets

Postby balamurali cl » Thu Sep 13, 2012 7:40 pm

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?
balamurali cl
 
Posts: 36
Joined: Mon Sep 03, 2012 9:01 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Information About the Migrated datasets

Postby Akatsukami » Thu Sep 13, 2012 8:49 pm

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.
"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: Information About the Migrated datasets

Postby NicC » Thu Sep 13, 2012 9:11 pm

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'.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Information About the Migrated datasets

Postby dick scherrer » Thu Sep 13, 2012 11:39 pm

but 'hown'
Shown?
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: Information About the Migrated datasets

Postby NicC » Fri Sep 14, 2012 1:19 pm

Ah - yes. The missing 'S' syndrome. I had one in that post as well - corrected now.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Previous

Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post