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
 

 

Need Suggestion on COBOL program

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

New User


Joined: 10 Jun 2015
Posts: 42
Location: India

PostPosted: Thu Jan 05, 2017 10:55 pm    Post subject: Need Suggestion on COBOL program
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: 1747
Location: Bloomington, IL

PostPosted: Thu Jan 05, 2017 11:05 pm    Post subject:
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: 42
Location: India

PostPosted: Thu Jan 05, 2017 11:12 pm    Post subject:
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: 1225
Location: Israel

PostPosted: Thu Jan 05, 2017 11:54 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1641
Location: NY,USA

PostPosted: Fri Jan 06, 2017 2:48 am    Post subject:
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    Post subject:
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    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 SQL query not working in Cobol program. CuriousMainframer COBOL Programming 10 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am


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