View previous topic :: View next topic
|
Author |
Message |
rupeshgullu
New User
Joined: 05 Oct 2010 Posts: 9 Location: Chandigarh
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
rupeshgullu
New User
Joined: 05 Oct 2010 Posts: 9 Location: Chandigarh
|
|
|
|
Requirement is to abend the program if it has more than 10 records. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
rupeshgullu
New User
Joined: 05 Oct 2010 Posts: 9 Location: Chandigarh
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
|