Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

alternate key on numeric field
How to convert or use a numeric field to put it into an alternate key for
accessing an indexed file ?

For example, I got :

ENVIRONMENT DIVISION.
..
INPUT-OUTPUT SECTION;
FILE-CONTROL.
SELECT FLIV ASSIGN TO DISK;
ORGANIZATION INDEXED;
ACCESS MODE DYNAMIC;
RECORD KEY IS COD-LIV;
ALTERNATE RECORD TTL-LIV;
ALTERNATE RECORD AUT-LIV DUPLICATES;
(* 1) // here I would use NTH-LIV, QT-LIV and QTR-LIV as
alternates key !!!
FILE STATUS IS FS-LIV;

DATA DIVISION.
FILE SECTION.
FD FLIV LABEL RECORD STANDARD;
VALUE OF FILE-ID IS "LIVRES.DAT".

01 ENR-LIV;
02 COD-LIV PIC 5(X).
02 TTL-LIV PIC 5(X).
02 AUT-LIV PIC 5(X).
02 NTH-LIV PIC 99.    <--- ??
02 QT-LIV PIC 99.       <--- ??
02 QTR-LIV PIC 99.     <--- ??






Report this thread to moderator Post Follow-up to this message
Old Post
gianluigi beuzard
03-14-06 08:55 AM


Re: alternate key on numeric field
"gianluigi beuzard" <gbeuzard@skynet.be> wrote in message
news:441687d9$0$1176$ba620e4c@news.skynet.be...
> How to convert or use a numeric field to put it into an alternate key for
> accessing an indexed file ?
>
> For example, I got :
>
> ENVIRONMENT DIVISION.
>  ...
>  INPUT-OUTPUT SECTION;
>   FILE-CONTROL.
>    SELECT FLIV ASSIGN TO DISK;
>           ORGANIZATION INDEXED;
>           ACCESS MODE DYNAMIC;
>           RECORD KEY IS COD-LIV;
>           ALTERNATE RECORD TTL-LIV;
>           ALTERNATE RECORD AUT-LIV DUPLICATES;
>           (* 1) // here I would use NTH-LIV, QT-LIV and QTR-LIV as
> alternates key !!!
>           FILE STATUS IS FS-LIV;
>
> DATA DIVISION.
>  FILE SECTION.
>   FD FLIV LABEL RECORD STANDARD;
>         VALUE OF FILE-ID IS "LIVRES.DAT".
>
>   01 ENR-LIV;
>        02 COD-LIV PIC 5(X).
>        02 TTL-LIV PIC 5(X).
>        02 AUT-LIV PIC 5(X).
>        02 NTH-LIV PIC 99.    <--- ??
>        02 QT-LIV PIC 99.       <--- ??
>        02 QTR-LIV PIC 99.     <--- ??

Use something like
02 alt-key.
03 nth-liv pic 99.
03 qt-liv pic 99.
03 qtr-liv pic 99.
with
alternate record alt-key

Or, if the compiler recognizes split-keys
(Micro Focus, for example)
alternate record alt-key = nth-liv qt-liv qtr-liv




Report this thread to moderator Post Follow-up to this message
Old Post
Rick Smith
03-14-06 12:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:04 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.