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
 

 

Performs until subscript Value reaches 10

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

New User


Joined: 05 Oct 2010
Posts: 9
Location: Chandigarh

PostPosted: Tue Mar 25, 2014 5:12 pm    Post subject: Performs until subscript Value reaches 10
Reply with quote

Hi I have one issue. There is an existing logic which performs until subscript it value reaches 10. This loops for 10 records and perfoms some para. After performing for 10 records it then comes out of loop and then writes the record. PFB the code
Code:

IF IN1-KEY = IN2-KEY                                 
   PERFORM UNTIL WS-SUB > 10                         
     OR IN1-KEY NOT = IN2-KEY                       
     PERFORM 4100-MATCH THRU 4100-EXIT               
     PERFORM 3000-READ-IN2 THRU 3000-EXIT           
   END-PERFORM                                       
   WRITE OUT-RECORD FROM PRC-EXT-REC                 
   ADD 1 TO OUT-CTR                                 
   MOVE 'Y' TO WS-BRKPT-SW                           
ELSE                                                 
   IF IN1-KEY < IN2-KEY                             
      IF WS-BRKPT-SW = SPACES                       
         MOVE PRC-EXT-AMT-POP                       
                            TO PRC-EXT-ASK-PRICE(1) 
         WRITE OUT-RECORD FROM PRC-EXT-REC           
         ADD 1 TO OUT-CTR                           
      ELSE                                           
         MOVE SPACES TO WS-BRKPT-SW                 
      END-IF     


there was one abend in Job where we had 13 records for key value and it abended with s013 code.
Now they then removed all 13 reocrds and program ran fine.
now it is required that of we have more than 10 records for that key it should abend and if it is less than 10 it shold follow the current logic.
Need to have the code change. Need help on this
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Mar 25, 2014 6:09 pm    Post subject: Reply to: change in Logic
Reply with quote

If what you say is accurate, you just have to abend after your loop if WS-SUB is greater than 10.

This assumes that WS-SUB is incremented in 3000-READ-IN2 or that if incremented in 4100-MATCH it reflects the number of records.

However, you're going to have to check on that. You need something which counts records per key. If you have that already, OK, if not you need to include code for it.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


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

PostPosted: Tue Mar 25, 2014 6:14 pm    Post subject:
Reply with quote

Is the ultimate need to abend if the key has 13 records or to process only those key which has 10 records?
Back to top
View user's profile Send private message
rupeshgullu

New User


Joined: 05 Oct 2010
Posts: 9
Location: Chandigarh

PostPosted: Tue Mar 25, 2014 6:47 pm    Post subject: Reply to: change in Logic
Reply with quote

Requirement is to abend the program if it has more than 10 records.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Wed Mar 26, 2014 7:43 am    Post subject:
Reply with quote

You need to show complete logic..

What logic is in place inside ,

Code:
PERFORM 4100-MATCH THRU 4100-EXIT               
     PERFORM 3000-READ-IN2 THRU 3000-EXIT   


How and where WS-SUB getting incremented and what is the declaration?

Why do you think S013 abend belongs to the mentioned code by you?

And even if you get more than 10 records for same key ( or why it failed when it was 13 only?), you are expecting to abend the program, why? and then will you be deleting them back again and restarting it?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


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

PostPosted: Wed Mar 26, 2014 8:54 am    Post subject:
Reply with quote

Add a sort step before this find the count of keys and if you find records with more than 10 for a key dont processs the program
Back to top
View user's profile Send private message
rupeshgullu

New User


Joined: 05 Oct 2010
Posts: 9
Location: Chandigarh

PostPosted: Wed Mar 26, 2014 10:54 am    Post subject:
Reply with quote

Hi,

WS-SUB is initiallized at read only. This program is going in for infinite loop when I ran it in Dev region and as per the client it should not process for more than 8 records. anything beyond 8 records are considered as duplicates.

in 4100-match-process para we just move the data to output variables based upon some condition and then read the second file

I have also given the same sugestion to reomove the ducplkciates using sort. so lets see what they reply
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Wed Mar 26, 2014 11:01 am    Post subject:
Reply with quote

Whatever you have described is very complicated and different than initial question.

however, why only today this job has a abend and not before? Does input file is not correct as it supposed to be ?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Wed Mar 26, 2014 2:40 pm    Post subject: Reply to: change in Logic
Reply with quote

There seems to be an architecture issue here - whatever is creating the dataset that you are reading is wrong and IT should be changed. If it is not wrong then the client is wrong by saying that there should be no more than 8 records.

An S013 would indicate that there is a problem reading a PDS but as you did not specify the reason code and we have no idea about the input file formats no one can really say. There seems to be confusion all over the place.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 26, 2014 7:06 pm    Post subject:
Reply with quote

Hello,

Which of the possible s013 abends was raised? Along with this, there should be a message with more info ablout the abend . . .
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Mar 26, 2014 7:35 pm    Post subject: Reply to: change in Logic
Reply with quote

Is the file a VSAM ESDS or KSDS?

A small Assembler sub-program would return the number of records on a given VSAM file, via a SHOWCB Macro.
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 Subscript vs Index Bill O'Boyle COBOL Programming 4 Thu May 31, 2012 4:16 pm
No new posts Index and subscript in Arrays ankita.maheswari11 COBOL Programming 9 Sat Aug 20, 2011 3:53 pm
No new posts Use subscript for index array??? royalchm COBOL Programming 7 Fri Mar 25, 2011 6:42 pm
No new posts what will happen if invalid subscript... sm_2009 COBOL Programming 7 Mon Jun 08, 2009 6:56 pm
No new posts DFHBMPRO not working for variables us... Sreeya CICS 10 Sat Apr 04, 2009 6:00 pm


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