Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

After LISTDSI control doesnt move to next stament

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
rajesh-amigos
Currently Banned

New User


Joined: 03 Aug 2007
Posts: 25
Location: India

PostPosted: Fri Aug 10, 2007 9:57 pm    Post subject: After LISTDSI control doesnt move to next stament
Reply with quote

I want to seewhether I can perform a certain Operation on a File. I have writen the following Code for this:-

Code:

/* REXX */
"alloc dataset('"var1"') f(datain)shr reuse"                     
DSINFO=LISTDSI(var3 DIRECTORY)
If SYSREASON !=0 Then DO                                         
 Select                                                         
  When SYSREASON = 3 then Say "Dataset is a type that cannot be processed"               
  When SYSREASON = 5 then Say "Dataset not Cataloged"                                   
  When SYSREASON = 8 then Say "Dataset is not on a DASD"                                 
  When SYSREASON = 9 then Say "DFHSM migrated the Dataset. NORECALL prevents retrieval" 
  When SYSREASON = 11 then Say "You haven't got sufficient authority for this operation" 
  When SYSREASON = 12 then Say "Cannot process VSAM"                                     
  Otherwise Nop
 End       
End                                                             


My problem is that once the function code from LISTDSI is not 0, the control doesnt move to the Select stament, rather it displays the message generated from the system.

Can somebody tell me what can i do to avoid this?
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Sat Aug 11, 2007 12:36 am    Post subject:
Reply with quote

Can you run it with TRACE I?

O.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Mon Aug 13, 2007 10:15 am    Post subject: Re: After LISTDSI control doesnt move to next stament
Reply with quote

Used <> instead of != and is working fine

Code:

/* REXX */                                                         
var1 = "AV5875.BSEUA.OUTPUT"                                       
SAY Var1                                                           
"alloc dataset('"var1"') f(datain)shr reuse"                       
DSINFO=LISTDSI(var3 DIRECTORY)                                     
say sysreason                                                     
If SYSREASON <>0 Then DO                                           
 Select                                                           
  When SYSREASON = 3 then Say "Dataset is a type that"             
  When SYSREASON = 5 then Say "Dataset not Cataloged"             
  When SYSREASON = 8 then Say "Dataset is not on a DAS"           
  When SYSREASON = 9 then Say "DFHSM migrated the Data"           
  When SYSREASON = 11 then Say "You haven't got suffic"           
  When SYSREASON = 12 then Say "Cannot process VSAM"               
  Otherwise Nop                                                   
 End                                                               
End                                                               


output

Code:

 AV5875.BSEUA.OUTPUT                   
 0005                                 
 Dataset not Cataloged                 
 ***                                   
Back to top
View user's profile Send private message
rajesh-amigos
Currently Banned

New User


Joined: 03 Aug 2007
Posts: 25
Location: India

PostPosted: Thu Aug 16, 2007 6:30 pm    Post subject: Signal Doubt
Reply with quote

/*REXX */
/*****************************************************
/* This code browses through the PDS given by the user
/* each member in edit mode. The EXEC then runs a ISRE
/* on each of them. The EXEC also writes a report in t
/* errors encountered along with the RC.
/*
/*****************************************************
Trace all
Signal on error name Error_Handler
Signal on failure name Error_Handler

Address tso
Say "Please enter the PDS you want us to traverse"
Pull var1
/*Say "The macro you want to use on the members"
Pull Var2*/
Pull Var2*/

If var1 = "" Then
Do
Say "No PDS name was entered"
Exit
End

var3 = "'"var1"'"
Listc=0
/*"alloc dataset('"var1"') f(datain)shr reuse"*/

/*X=Outtrap(Listc.)*/
DSINFO=LISTDSI(var3 DIRECTORY)
/*X=Outtrap("OFF")*/

Say SYSDSORG
If SYSDSORG = 'PO' Then Do
X=Outtrap(Listc.)
"LISTDS '"var1"' MEMBERS "
X=Outtrap("OFF")

Do I=1 to 3
say listc.i
End
Say "There are " ((Listc.0)-6)" members in the PDS"

"ISPEXEC LMINIT DATAID(datain) DATASET('"var1"')"
Say "Members Returncode"
varcount = 0
Do I=8 to listc.0
Listc.i = STRIP(Listc.i)
Address ISPEXEC "EDIT DATASET('"var1"("listc.i")')
MACRO ("packoff")"
RC_Open = RC
Say listc.i RC
End
End
Else
Do
Say "This file is not a PDS"
Say "However we will still try to process the file"
Address ISPEXEC "EDIT DATASET('"var1"')
MACRO ("packoff")"
End

Error_Handler :
/*If SYSREASON <> 0 Then DO
Say "SYSREASON =" SYSREASON
Select
When SYSREASON == 3 then
Say "Dataset is a type that cannot be processed"
When SYSREASON = 5 then
Say "Dataset not Cataloged Moron"
When SYSREASON == 8 then
Say "Dataset is not on a DASD"
When SYSREASON == 9 then
Say "DFHSM migrated the Dataset. NORECALL prevents retrieval"
When SYSREASON == 11 then
Say "You haven't got sufficient authority for this operation"
When SYSREASON == 12 then
Say "Cannot process VSAM"
Otherwise
End
Exit*/

If RC_OPEN = 14
Say "There were some errors"
Say "The report has been written to the file"
Say Listc.i
End


My Queston is if the Sysreason from LISTDSI is not 0, Then the Control does move to Error_Handler :.

However when the Return code from EDIT DATASET is non zero, the control doesnt move to Error_Handler, instead I get a Screen named ISPF ISRE093, which says "Member in Use". When Runing the code in Trace mode, I found out that the controld goes to ISPF as soon as the code for Editing the open member is encountered.

How can I supress the screen and deliver the message from my own code?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us