MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

READ PREV for index file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
aniscorp
Beginner


Joined: 24 Apr 2006
Posts: 14
Topics: 3

PostPosted: Mon Apr 24, 2006 5:54 am    Post subject: READ PREV for index file Reply with quote

1. The READ PREV syntax is not supported by the compiler and I have to read the previous records in a VSAM file. Can anyone suggest an option.

2. Secondly, the START key does not support "<=" combination. Is there a way out to direectly point to less than or equal to the value of the key.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Mon Apr 24, 2006 8:31 am    Post subject: Reply with quote

Quote:

The READ PREV syntax is not supported by the compiler and I have to read the previous records in a VSAM file. Can anyone suggest an option.


aniscorp,

Almost all the versions of COBOL support Readprev. what version of cobol are you talking about?

Quote:

2. Secondly, the START key does not support "<=" combination. Is there a way out to direectly point to less than or equal to the value of the key.


says who ? The mainframe Cobol DOES support start with <= . Check this link

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/6.2.35?DT=20020920180651

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
aniscorp
Beginner


Joined: 24 Apr 2006
Posts: 14
Topics: 3

PostPosted: Tue Apr 25, 2006 1:00 am    Post subject: Reply with quote

Kolusu,

The version of cobol is:
1PP 5668-958 IBM VS COBOL II Release 4.0 09/15/92

And compilers are:
PROC GROUP...... CIIG1B01
PROCESSOR....... GBNSCBB1

The errors in compile listing is as follows:
1. For Start <= key:
519 IGYPS2106-S "<=" was found in the "START" statement. The statement was dhe "START" statement. The statement was discarded.

2. For READ PREV key
526 IGYPS2072-S "PREV" was invalid. Skipped to the next verb, period or proc Skipped to the next verb, period or procedure-name definition.

And the Code is:

000519 000821 START INDEX-FILE KEY NOT <= INDX-KEY
000520 000822 INVALID KEY
000521 000823 MOVE INDEX-NOT-FOUND-MSG-01
000522 000824 TO INDX-COMM-INDX-ERROR-MSG
000523 000825 MOVE 9 TO INDX-COMM-PROCESS-IND
000524 000826 GO TO 10000-START-INDEX-EXIT.
000525 000827
000526 000828 READ INDEX-FILE PREV RECORD
000527 000829 AT END
000528 000830 MOVE INDEX-NOT-FOUND-MSG-04
000529 000831 TO INDX-COMM-INDX-ERROR-MSG
000530 000832 MOVE 9 TO INDX-COMM-PROCESS-IND
000531 000833 MOVE 'Y' TO INDX-FOUND-SW.
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Apr 25, 2006 4:38 am    Post subject: Reply with quote

aniscorp,

Your compiler does indeed support <=, but it doesn't support "NOT <=".
You should use ">" instead. Check here:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGYL1101/3.33?DT=19930312093006

I think you do have a problem with PREVIOUS.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
aniscorp
Beginner


Joined: 24 Apr 2006
Posts: 14
Topics: 3

PostPosted: Tue Apr 25, 2006 5:07 am    Post subject: Reply with quote

sorry seems that there was a typo in last line while posting the syntax, it is:
>>--START--file-name-1--------------------------------------------------

>-----------------------------------------------------------------------
+-KEY------------EQUAL----------------------------------data-name-1-+
+-IS-+
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Apr 25, 2006 8:24 am    Post subject: Reply with quote

You've lost me. Confused

Are you saying the code you posted was not the actual code that caused the problem?
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
aniscorp
Beginner


Joined: 24 Apr 2006
Posts: 14
Topics: 3

PostPosted: Wed Apr 26, 2006 1:19 am    Post subject: Reply with quote

Mervyn,

Please ignore my last post, as I might have confused you. But here is the complete summary of the problem:

The code which is in my cobol program is as follows:
START INDEX-FILE KEY NOT <INDX>=, or key NOT <. But there is no mention of Key <=.

Because of this constrain of the START key unable to use the <= condition, the job in the production takes around 10 hours to run and we are in the process of optimizing the same. I had tried all possible methods, i.e increasing the BUFSP, BUFNI, Region etc, but nothing works.
Since this file is searched 3 times each by 9 million records and as there is no direct read possible due to the START key constrain, the program reads one by one record until the <= condition is met.

I hope this explanation would have helped in giving a clear picture of the actual problem.

Regards,
Aniscorp
Back to top
View user's profile Send private message
aniscorp
Beginner


Joined: 24 Apr 2006
Posts: 14
Topics: 3

PostPosted: Wed Apr 26, 2006 1:24 am    Post subject: Reply with quote

I guess that after posting, the text has again got rearranged and before it is going to create another confusion, Iam re-sending it thru Qucik reply as below:

Mervyn,

Please ignore my last post, as I might have confused you. But here is the complete summary of the problem:

The code which is in my cobol program is as follows:
START INDEX-FILE KEY NOT <INDX>=, or key NOT <. But there is no mention of Key <=.

Because of this constrain of the START key unable to use the <= condition, the job in the production takes around 10 hours to run and we are in the process of optimizing the same. I had tried all possible methods, i.e increasing the BUFSP, BUFNI, Region etc, but nothing works.
Since this file is searched 3 times each by 9 million records and as there is no direct read possible due to the START key constrain, the program reads one by one record until the <= condition is met.

I hope this explanation would have helped in giving a clear picture of the actual problem.

Regards,
Aniscorp
Back to top
View user's profile Send private message
aniscorp
Beginner


Joined: 24 Apr 2006
Posts: 14
Topics: 3

PostPosted: Wed Apr 26, 2006 1:28 am    Post subject: Reply with quote

Mervyn wrote:
You've lost me. Confused

Are you saying the code you posted was not the actual code that caused the problem?



    Mervyn,

    Please ignore my last post, as I might have confused you. But here is the complete summary of the problem:

    The code which is in my cobol program is as follows:
    START INDEX-FILE KEY NOT <= INDX-KEY

    And the compiler gave me error as follows:
    519 IGYPS2106-S "<=" was found in the "START" statement. The statement was discarded.

    And even the link which you had mentioned only speaks of START key accepting Key =, or Key >=, or key NOT <. But there is no mention of Key <=.

    Because of this constrain of the START key unable to use the <= condition, the job in the production takes around 10 hours to run and we are in the process of optimizing the same. I had tried all possible methods, i.e increasing the BUFSP, BUFNI, Region etc, but nothing works.
    Since this file is searched 3 times each by 9 million records and as there is no direct read possible due to the START key constrain, the program reads one by one record until the <= condition is met.

    I hope this explanation would have helped in giving a clear picture of the actual problem.

    Regards,
    Aniscorp
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sat Apr 29, 2006 6:39 pm    Post subject: Reply with quote

Hi Aniscorp,

You say the prod version takes 10 hrs+ because of the START cmd restrictions. Why don't you show us the code it uses to get around them?
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
aniscorp
Beginner


Joined: 24 Apr 2006
Posts: 14
Topics: 3

PostPosted: Fri May 05, 2006 1:58 am    Post subject: Reply with quote

slade wrote:
Hi Aniscorp,

You say the prod version takes 10 hrs+ because of the START cmd restrictions. Why don't you show us the code it uses to get around them?


The code is:
Code:

000249     MOVE 'H'                 TO INDX-RCD-TYPE. 
000250     MOVE 'P'                 TO INDX-RCD-IND.   
000260     MOVE INDX-COMM-PART-KEY  TO INDX-TABLE-ID. 
000708     PERFORM 20100-START-PART-RATE THRU 
000709             20100-START-PART-RATE-EXIT.
000715     MOVE ZEROS               TO WRK-P-DEP-DATE.   
000716     MOVE ZEROS               TO WRK-P-EFF-DATE.   
000719     PERFORM 20110-GET-PART-RATE THRU 
000720             20110-GET-PART-RATE-EXIT 
000721                 UNTIL RATE-FOUND.
.
.   
----------------------------------------------

001091 20100-START-PART-RATE.                                 
001092                                                         
001093     START INDEX-FILE KEY NOT <INDX> WORK-ISS-DATE             
001123         MOVE 'Y'             TO RATE-FOUND-SW     
001124         GO TO 20110-GET-PART-RATE-EXIT.           
001128     IF (INDX-P-EFF-DATE < WORK-EFF-DATE OR     
001129         INDX-P-EFF-DATE = WORK-EFF-DATE)       
001132         MOVE INDX-P-DEP-DATE TO WRK-P-DEP-DATE
001133         MOVE INDX-P-EFF-DATE TO WRK-P-EFF-DATE
001135         MOVE INDX-P-PRCNT    TO WRK-PART-RATE   
001137     ELSE                                       
001138         ADD 1                TO INDX-P-DEP-DD 
001139         MOVE ZEROS           TO INDX-P-EFF-MM 
001140         MOVE ZEROS           TO INDX-P-EFF-DD 
001141         PERFORM 20100-START-PART-RATE THRU     
001142                 20100-START-PART-RATE-EXIT     
001143         GO TO 20110-GET-PART-RATE-EXIT.       
001145                                                   
001146     READ INDEX-FILE NEXT RECORD                   
001147       AT END                                     
001148         MOVE 'Y'             TO RATE-FOUND-SW     
001149         GO TO 20110-GET-PART-RATE-EXIT.           
001190 20110-GET-PART-RATE-EXIT.   
001191     EXIT.                   
001192*                           

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group