Mine are in general 
FILTLIST(s)
A prolog of debug and preliminary stuff.
One large SELECT
Some final cleanup and defaults.

I have a Rexx I run against the routines to turn debug say statements on
and off. I don't generally use EXIT.

proc 1 DATACLAS                                              
/*   DATACLAS executed first for new allocations only */     
filtlist VTAPE    include ('VTAPE','3480','3490','3590')     
,........
filtlist NOMIG    include(CATALOG.**,ICFCAT.**,SMS.**)

if (&DSTYPE ne 'TEMP') then

    write 'dc  dc=' &DATACLAS ' size=' &SIZE     ' user=' &USER

             ' sc=' &STORCLAS   ' mc=' &MGMTCLAS ' sg=' &storgrp

if (&DATACLAS = 'GDG' or &DATACLAS = 'DEFAULT') then set &DATACLAS = ''

select

  when (&DSNTYPE = 'HFS')

   do /*D*/

      write ' a' /*D*/

      set  &DATACLAS = 'HFS' /*S*/

   end /*D*/

  when (&DSN = &SMF)

   do /*D*/

      write ' b' /*D*/

      set  &dataclas = 'SMF' /*S*/

   end /*D*/

  when (&DSN = SMTP.**)

.........
otherwise                                       
   if &DATACLAS ne '' then                      
      if   &DATACLAS = 'NOEXTEND' then          
       do /*D*/                                 
          write ' m' /*D*/                      
          set &DATACLAS = 'BIG' /*S*/           
       end /*D*/                                
      else                                      
       do /*D*/                                 
          write ' n' /*D*/                      
          set &DATACLAS = &DATACLAS /*S*/       
       end /*D*/                                
   else                                         
       if   &DSORG    = 'PO' then               
        do /*D*/                                
           write ' o' /*D*/                     
           set &DATACLAS = 'DEFLTPDS' /*S*/     
        end /*D*/                               
........
       else                                     
            else                                            
             do /*D*/                                       
                write ' r' /*D*/                            
                set &DATACLAS = 'DEFAULT' /*S*/             
             end /*D*/                                      
end                                                         
if (&DSTYPE ne 'TEMP') then                                 
   write 'dcx dc=' &DATACLAS                                
end                                                         

Dave Gibney
Information Technology Services
Washington State University


> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of McKown, John
> Sent: Thursday, April 14, 2011 10:24 AM
> To: [email protected]
> Subject: ACS routine coding philosophy
> 
> I'm going to re-engineer our ACS routines. They are a mess. But I'm
curious
> about the "best" way. I've narrowed it down to two techniques. The
> simpliest, to me, is to just use a series of IF statements where the
THEN
> portion ends with an EXIT to terminate the ACS routine. The more
> complicated, but perhaps more efficient, way is to use nested SWITCH
and IF
> statements. I like the straight IF simply because I think it will be
easier to
> understand. And I don't mean nested IFs. I mean something like:
> 
> IF cond1 AND cond2 AND cond3 THEN DO
>     ...
>     EXIT
> END
> IF cond1 AND cond2 THEN DO
>    ...
>    EXIT
> END
> IF cond1 THEN DO
>    ...
>    EXIT
> END
> 
> instead of:
> 
> IF cond1 THEN DO
>     IF cond2 THEN DO
>         IF cond3 THEN DO
> ...
>         END
>         ELSE DO
> ...
>        END /* OF ELSE */
>    END /* OF IF cond2 */
>    ELSE DO /* OF IF cond1 */
> ...
> END /* OF IF cond 1 */
> 
> Of course my "series of simple IFs" philosophy will result in more
code being
> written and executed. I just have a "gut feel" that it will be easier
to
> understand and maintain. I may relent a bit if I need to do a simple
set of IFs
> within a DO. Perhaps it would be "no nested DO groups". Eg:
> 
> IF cond1 AND cond2 THEN DO
>     ...
>     IF cond3 THEN SET ..
>     IF cond4 THEN SET ...
>     IF cond5 THEN SET ...
>     IF cond6 THEN SET ...
>     EXIT
> END
> 
> I really want it to be simple and easy to understand and maintain. Not
like my
> Perl and APL code! <grin>
> 
> John McKown
> Systems Engineer IV
> IT
> 
> Administrative Services Group
> 
> HealthMarkets(r)
> 
> 9151 Boulevard 26 * N. Richland Hills * TX 76010
> (817) 255-3225 phone *
> [email protected] * www.HealthMarkets.com
> 
> Confidentiality Notice: This e-mail message may contain confidential
or
> proprietary information. If you are not the intended recipient, please
contact
> the sender by reply e-mail and destroy all copies of the original
message.
> HealthMarkets(r) is the brand name for products underwritten and
issued by
> the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life
> Insurance Company(r), Mid-West National Life Insurance Company of
> TennesseeSM and The MEGA Life and Health Insurance Company.SM
> 
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send
email to
> [email protected] with the message: GET IBM-MAIN INFO Search the
> archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to