What are your shops standards?
From:
"Stone, Joel" <Joel.Stone@xxxxxxxxxx>
To:
"midrange-l@xxxxxxxxxxxx" <midrange-l@xxxxxxxxxxxx>, 
Date:
05/29/2012 09:36 AM
Subject:
CL code formatting and programming etiquette
Sent by:
midrange-l-bounces@xxxxxxxxxxxx
When you create CL code, do you try to make it easy to read ie use lower 
case; add some white space, skip keywords such as COND and VAR and THEN, 
and line things up?
Like this:
             select 
               when      (&reportID = 'LS') goto report_LS 
               when      (&reportID = 'SR') goto report_SR 
               when      (&reportID = 'SB') goto report_SB 
               otherwise                    goto endpgm 
             endselect 
 
report_LS: 
             chgvar     &TITLE1 'New Customer Report' 
             chgvar     &TITLE2 'Trader Notification' 
             chgvar     &SHOWCUST 'N' 
             chgvar     &QRYSLT (&QRYSLT *bcat ' ASHPSTS = + 
                          "UT" *and ASLSCNT = 0 *and ACTMDTR = "R"')
******************************************************
Or
******************************************************
Do you run everything thru the prompter, like this:
             select 
             WHEN       COND(&REPORTID = 'LS') THEN(GOTO + 
                          CMDLBL(REPORT_LS)) 
             WHEN       COND(&REPORTID = 'SR') THEN(GOTO + 
                          CMDLBL(REPORT_SR)) 
             WHEN       COND(&REPORTID = 'SB') THEN(GOTO + 
                          CMDLBL(REPORT_SB)) 
             OTHERWISE  CMD(GOTO CMDLBL(ENDPGM)) 
             ENDSELECT 
 
report_LS: 
             CHGVAR     VAR(&TITLE1) VALUE('Loaded Cars Available + 
                          for Sale') 
             CHGVAR     VAR(&TITLE2) VALUE('Trader Notification') 
             CHGVAR     VAR(&SHOWCUST) VALUE('N') 
             CHGVAR     VAR(&QRYSLT) VALUE(&QRYSLT *BCAT ' ASHPSTS = + 
                          "UT" *and ASLSCNT = 0 *and ACTMDTR = "R"') 
Which method is preferred or more widely used?
I always do the former (mixed case, skip keywords).
A co-worker goes thru my code and prompts it all into the harder-to-read 
(imo) ALL CAPS stuff.
Is this following IT etiquette?
I realize people alter other's code over the years.  But this is happening 
prior to initial promotion.
Does such an etiquette  concept exist in the IT development field?
______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs 
Skyscan service.
For more information please visit 
http://www.symanteccloud.com
______________________________________________________________________
As an Amazon Associate we earn from qualifying purchases.