MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Searching A PDS Using An Exclusion Criterion

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Ganti
Beginner


Joined: 04 Dec 2002
Posts: 8
Topics: 3
Location: St.Louis, MO, USA

PostPosted: Thu Jan 09, 2003 4:36 pm    Post subject: Searching A PDS Using An Exclusion Criterion Reply with quote

Hi,
I am here with a situation to list out all the members in the COBOL source PDS that have a

"BLOCK CONTAINS <any value apart from 0> RECORDS".

The reason I will want to do that is to have the BLKSIZE parameter in the DCB for the dataset, in the corresponding JCL removed, so that the system determines the best block size.

I can not use Super CE for exclusion, any suggestions in FILEAID or otherwise are much appreciated.

Thanks and regards
Ganti
_________________
Ganti
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Thu Jan 09, 2003 5:20 pm    Post subject: Reply with quote

Ganti,
this is what I think you want to do. Although I'm a little unsure, could you please clarify this. It also appears that you may be part way through the process and have a list of the JCL and programs/or ddnames that need to be amended.

Search through the COBOL source for any occurence of BLOCK CONTAINS nn RECORDS (where nn must be greater than 0. For each such occurence, locate the JCL that invokes the program, as determined by the COBOL source member name (or is it any occurence of the DDNAME associated with the file clause [sorry I'm not a COBOL programmer so am not too sure of the correct terminology], amend the JCL to remove the BLKSIZE parameter.

Are you expecting a fully automated process? or are you just looking for soemthing to remove the BLKSIZE parameter?

With more specific information I have little doubt that we can assist you.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Thu Jan 09, 2003 5:26 pm    Post subject: Reply with quote

Ganti,

I think FILE-AID can handle it , but i need to refresh my memory for syntax.Another idea is to invoke superce and later on strip off the unwanted members using sort utility.

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
naveen
Beginner


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Fri Jan 10, 2003 12:58 am    Post subject: Reply with quote

Have you tried File-Aid 3.6 option:
Search/Update Utility

In think , it can do , what you want.

For only search(not update) , use option 'M' as the OPTION.
Back to top
View user's profile Send private message Send e-mail
naveen
Beginner


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Fri Jan 10, 2003 1:11 am    Post subject: Reply with quote

1. Use option 3.14 to search the string 'Block Contains' and in the
listing dataset use the dataset name SEARCH.RESULT

Code:
Listing Data Set . . . SEARCH.RESULT 


2. Once your XXXXXXXX.SEARCH.RESULT dataset has been created use this job to create the list you want :

Where XXXXXXXX is your ID and
XXXXXXX.SEARCH.RESULT dataset created after using 3.14 search option

Code:
//PSSTEP   EXEC PGM=SORT
//*
//SYSOUT   DD  SYSOUT=*                 
//SORTIN   DD  DSN=XXXXXXX.SEARCH.RESULT,
//             DISP=SHR                 
//SORTOUT  DD  DSN=XXXXXXX.SEARCH.LIST, 
//             DISP=(NEW,CATLG,CATLG),     
//             UNIT=SYSDA,               
//             SPACE=(CYL,(X,Y),RLSE)
//*                                     
//SYSIN    DD  *                         
  SORT FIELDS=COPY                       
  OMIT COND=(1,133,SS,EQ,C'BLOCK CONTAINS 0 RECORDS')         
//*                                     


3. XXXXXXX.SEARCH.LIST is what you want.
Back to top
View user's profile Send private message Send e-mail
naveen
Beginner


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Fri Jan 10, 2003 1:20 am    Post subject: Reply with quote

Or simply use this job:

Code:
//SEARCH  EXEC PGM=ISRSUPC,                       
//            PARM=(SRCHCMP,                       
//            'ANYC')                             
//NEWDD  DD DSN=XXXXXXX.SOURCE.PDS,               
//          DISP=SHR                               
//OUTDD  DD DSN=XXXXXXX.SEARCH.RESULT,             
//          DISP=OLD                               
//SYSIN  DD *                                     
SRCHFOR  'BLOCK CONTAINS'                                 
/*                       
//*
//PSSTEP   EXEC PGM=SORT
//*   
//SYSOUT   DD  SYSOUT=*                 
//SORTIN   DD  DSN=XXXXXXX.SEARCH.RESULT,
//             DISP=SHR                 
//SORTOUT  DD  DSN=XXXXXXX.SEARCH.LIST, 
//             DISP=(NEW,CATLG,DELETE),     
//             UNIT=SYSDA,               
//             SPACE=(CYL,(X,Y),RLSE)
//*                                     
//SYSIN    DD  *                         
  SORT FIELDS=COPY                       
  OMIT COND=(1,133,SS,EQ,C'BLOCK CONTAINS 0 RECORDS')         
//*
Back to top
View user's profile Send private message Send e-mail
Himesh
CICS Forum Moderator
CICS Forum Moderator


Joined: 20 Dec 2002
Posts: 80
Topics: 21
Location: Chicago

PostPosted: Fri Jan 10, 2003 1:37 am    Post subject: Reply with quote

How about good old REXX. Couldn't test it though!

Steps:

1. Get list of all members.
2. Eliminate all members which have the "Block contains 0 records" statement.
3. In the remaining members, find those members that have the "block contains" statement.

[code:1:21ce2dc108]


/* REXX */
/* The ds name is an input to this REXX */

ARG pdsname
IF pdsname = ""
THEN DO
SAY "Error, no arguments entered"
SAY "Ending"
EXIT 8
END

IF SYSDSN(pdsname) <> "OK"
THEN DO
SAY "Error:" pdsname SYSDSN(pdsname)
SAY "Ending"
EXIT 8
END

/* get all the members in the PDS */

CALL OUTTRAP "trap."
"LISTD" pdsname "MEMBERS"
CALL OUTTRAP "off"

DO i=1 TO trap.0
IF trap.i = "--MEMBERS--"
THEN LEAVE
END

CALL LISTDSI pdsname
dsname = sysdsname

i = i + 1
cnt = 0

/* For each member in the PDS, the Do loop is used to read each thru each member */

string =
Back to top
View user's profile Send private message Yahoo Messenger
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Fri Jan 10, 2003 3:33 am    Post subject: Reply with quote

Hi,

If you are using REXX, then you can also always use LM facilities and an edit macro to do the same.

The Rexx driver program will be something like -

Code:

/* rexx */
say 'Enter the PDS name:'
pull indsn
x=LISTDSI(indsn)
if x=16 then
   do
       say 'Input DSN not processed'
       call exit_para
   end
else
   if SYSDSORG='PO' then nop
   else
       do
           say 'The input DSN was not a valid PDS'
           call exit_para
       end

ADDRESS ISPEXEC
"LMINIT DATAID(indd) DATASET("indsn") ENQ(SHR)"
"LMOPEN DATAID("indd")"
memn = ''
"LMMLIST DATAID("indd") OPTION(LIST) MEMBER(memn)"
lmrc=rc
do while lmrc = 0
say 'Processing Member:' memn
"EDIT DATAID("indd") MEMBER("memn") MACRO(SRCBLK)"
"VGET(fblock) ASIS"
if fblock = 'y' then
   say 'Member' memn 'has a block contains phrase mentioned which is   
          not zero'
else nop
"LMMLIST DATAID("indd") OPTION(LIST) MEMBER(memn)"
lmrc = rc
end
say 'Processing of all members complete..'
exit
exit_para:
say 'Quitting from the application..'
exit


The Edit macro will be something like -

Code:

/* rexx */
ADDRESS ISREDIT
"macro"
fblock = 'n'
"FIND 'BLOCK CONTAINS 0 RECORDS' ALL .ZF .ZL"
if rc = 0 then nop
else
   do
      "FIND 'BLOCK CONTAINS' .ZF .ZL"
       if rc=0 then
           do
              fblock = 'y'
              ISPEXEC "VPUT (fblock) ASIS"
           end
   end
"CAN"
return


Basically this is a similar approach to what Himesh has suggested but I personally like using edit macros. Smile

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Fri Jan 10, 2003 8:07 am    Post subject: Reply with quote

manas,

I don't understand why you choose to code conditionals like:

Code:

if rc = 0 then nop


It reminds me of silly old COBOL programs with NEXT SENTANCE etc. Why not

Code:

if rc > 0 then ...

_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
faisal
Beginner


Joined: 05 Dec 2002
Posts: 8
Topics: 1

PostPosted: Fri Jan 10, 2003 1:03 pm    Post subject: Reply with quote

I don't think you need to do all the rexx stuff for this. You do have the exclusion option in superc. Just go to the the options menu and select procesing statements. I don't remember the exact options, but you can add a statement like "DPCLINE '0'" which will tell superc to ignore lines containing the string "0" in the same line where the search string is found. You'll get it in one shot. Seach for "RECORD CONTAINS" and exlcude lines containing " 0 ". You can also set processing options to consider columns between 7 and 72, and also to ignore cobol comment lines.

HTH

faisal
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Jan 13, 2003 2:41 am    Post subject: Reply with quote

Thanks Dave for the suggestion. Old Habits Die Hard - I guess. I will keep it in mind the next time I code any REXX program.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group