IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need Suggestion on COBOL program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Thu Jan 05, 2017 10:55 pm
Reply with quote

Hi All,

I have written a COBOL program which has three cursors.Requirement was to read data from one SQL(cursor1) and based on values retrieved from cursor1 read cursor2,cursor3 and the write data to output file after performing some Computations.

I have written logic to read first cursor1 and based on retrieved values read cursor2,perform computation, write output file for cursor 2 till end of cursor2. And then for same values of cursor1 read cursor3 till end and write simultaneously.

My program is working perfectly fine and i an getting expected output.

But in my shop before code moved to production it has to pass SONAR.

And this sonar report is saying this program this has complexity much higher that authorized.

I believe i am getting this complexity message because of loops involved in program.

It will be a great help if you can suggest me better ways to write this program and remove this high complexity problem.


Thanks
Vickey
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Thu Jan 05, 2017 11:05 pm
Reply with quote

And SONAR (whatever that is) does not identify what features of the program are excessively complex? I'd challenge it on those grounds; it's obviously in error.
Back to top
View user's profile Send private message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Thu Jan 05, 2017 11:12 pm
Reply with quote

No unfortunately it doesn't point out which part are complex.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Jan 05, 2017 11:54 pm
Reply with quote

You have only 2 alternatives, I think:
1. Locate the team responsible for SONAR and ask them to revise their criteria or to allow your program.
2. Simplify your program.

Edit:
3. Split your program into sub-routines.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Fri Jan 06, 2017 2:48 am
Reply with quote

We use SONAR too.
When you search you program , it gives you blockers, critical messages and the corresponding impacted code.
So get the link of Sonar and search your module and see the error and fix it if you can't then explain it to responsible people why you can't do.
Back to top
View user's profile Send private message
venkatesh.nayak

New User


Joined: 07 Jan 2007
Posts: 3
Location: Bangalore

PostPosted: Fri Jan 13, 2017 11:34 am
Reply with quote

I would suggest you that use JOINS in place of retrieving data from Cursor 1 and then cursor2 AND later Cursor 1 and then cursor3.

JOIN Cursor1 Query with Cursor2 Query and execute it as single cursor. This would atleast saves upper level looping performing twice and can release hold resources as well
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top