× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Joel

I don't know about etiquette - if the person promoting has a higher pay grade, they get to do what they want, right?

I don't remember whether y'all have started using RDP for development - I mention in another reply in this thread the options you have there - it's not going to give you exactly what you start out with here, but it could give your shop a way to establish a reasonable compromise/standard and everyone would have a better chance of being consistent.

I don't personally like a single command on WHEN or IF or even MONMSG - I almost always make a DO block. Yeah, not really needed for a single command, but I don't trust that the code will never expand.

BTW, V5R3 (where the SELECT was introduced) also has subroutines in CL - those could serve you better than the GOTOs, perhaps.

One man's Mede is another man's Persian, as they used to say!

Vern

On 5/29/2012 9:36 AM, Stone, Joel wrote:
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.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.