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
 

 

Cobol option to hide some part of code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Jun 05, 2013 7:54 pm    Post subject: Cobol option to hide some part of code
Reply with quote

Is there a cobol option that could allow us to hide some part of code across different level?

Level here means Dev,test,uat,prod

And I use SCLM for version control

Also if there is some kind of option exist does it need to be done along at the time of some setup?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jun 05, 2013 7:56 pm    Post subject: Reply to: Cobol option
Reply with quote

what do You mean by <HIDE> ???
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Jun 05, 2013 8:33 pm    Post subject:
Reply with quote

For example :

If have added some displays and not have removed I dont want them to be shown in prod but made available in lower regions
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 05, 2013 9:14 pm    Post subject:
Reply with quote

you could use the D in column 7 and in the the 'with debugging mode' in the SOURCE COMPUTER para.
but then you have to remove (or comment-out) the 'with debugging mode'
before you compile for the prod version.

otherwise there is nothing you can do,
except of course add a file with a record that you would always have to check (in prod as well as test).

unfortunately there is nothing you can do to tell the compiler (other than compiler options)
to do something.

D in 7 is treated as a comment when the 'with debugging mode' is not present in the source.
the lines will still be in the source, but do not generate any object code.
with a d in 7, you can lay any code that you want. object is generated with the 'with debugging mode' clause,
and without the clause, the D in 7 is treated as an asterisk (*) by the compiler

unfortunately, most resource products move the latest object and do not create a new one upon entry to another 'region' (test prod, etc..).

if you have no debugging tool in-house, then displays are one of the few means of debugging that you have.

on the other hand, if you have a production problem, without the displays you are still canoeing without a paddle.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Jun 05, 2013 9:27 pm    Post subject:
Reply with quote

The Biggest concern we have is that too many changes external interfaces involed for couple of them we have no control atleast my team perspective and too much of business case involved so its a crunchy situation that even 70% ok code is ok to be in prod so for the rest of 30% not ok code I need displays

I heard of the option D but never tried it yet

Thanks for the inputs Dick
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jun 05, 2013 11:15 pm    Post subject: Reply to: Cobol option
Reply with quote

Perhaps if you put the SOURCE-COMPUTER in a copybook. In Production source, the copybook can just contain a comment explaining that there is nothing there ("This Copybook Intentionally Left Blank").

Then in the other environments, the copybook contains the appropriate SOURCE-COMPUTER paragraph.

When promoting to Production, the copybook just never makes its... and the D lines are treated as comments in the Production compile.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jun 06, 2013 12:03 am    Post subject:
Reply with quote

There is another concern we don't maintain discrete cookbooks across levels so I am afraid or I did not get your point correctly

Due to the patch we made in SCLM in our shop we compile only once in user level rest of the level we just move to next levels
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Jun 06, 2013 12:15 am    Post subject:
Reply with quote

Pandora-Box wrote:
There is another concern we don't maintain discrete cookbooks across levels

Sounds like a recipe for disaster icon_wink.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jun 06, 2013 12:20 am    Post subject: Reply to: Cobol option
Reply with quote

Wow, don't tell the Auditors :-)

Can you recreate any given source from, say, two years four months and three days ago, and guarantee that when compiled the object code is identical to the Production object code at that time? I suspect not.

Fail of a Computer Audit, without looking anywhere further.

Anyway, the Ds won't work then.

The "Debugging Declaratives" might give you something, because they can be set on/off by an option (in various ways, my preference being CEEOPTS DD statement). There is some "performance" penalty if turning off what has been compiled in, because a switch needs to be tested for every reference/use of a paragraph/SECTION.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jun 06, 2013 12:23 am    Post subject:
Reply with quote

No those were repercussions or advantage of the patch which eased some clock
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jun 06, 2013 12:31 am    Post subject:
Reply with quote

Thanks Bill will try that CEEOPTS when I get back to my desk next week

Thanks for those pointers icon_smile.gif
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Thu Jun 06, 2013 2:37 am    Post subject:
Reply with quote

I'm looking for a CICS program I did this to and I cannot find it. It was basically an "IF" statement. I can't even remember the situation now. If I come accorss it I'll let ya know.
if "prod"
do-something
else
do-something-else
end-if
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jun 06, 2013 3:50 am    Post subject: Reply to: Cobol option
Reply with quote

Perhaps UPSI.

This is one byte of on/off values (0-7) which you can interrogate from COBOL and set in the JCL.

Looked like this when I used it last:

Code:
// UPSI 1000000


But that was on DOS/VS

It is now something the LE provides, so again can be set through the various LE Options possibilities and tested in a program:
Code:

IF Testing-Environment
    do something
END-IF


You then establish Testing-Environment and relate it to the UPSI in the SPECIAL-NAMES paragraph of the ENVIRONMENT DIVISION.

You have eight on/off switches, which you could use for your different environments, or just have Prod/Non-Prod or even get into combinations of the settings which would give a total of 256 possibilities :-)

This may be less "intrusive" that having a file as dbz suggested (can be a simple DD * anyway) or a PARM.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


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