View previous topic :: View next topic
|
Author |
Message |
mmurilloa
New User
Joined: 31 May 2023 Posts: 2 Location: MEXICO
|
|
|
|
Coding a new program I'm trying to use this:
SELECT AMBSR ASSIGN TO AMBSR
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS AMBS-KEY
FILE STATUS IS FS-AMBSR.
FD AMBSR.
01 REG-AMBS.
03 AMBS-KEY.
05 AMBS-APP PIC X(013).
05 AMBS-CUENTA PIC X(019).
01 WS-AMBS-FILE.
03 FILLER PIC X(006) VALUE 'AMBSR1'.
03 FILLER PIC X(006) VALUE 'AMBSR2'.
03 FILLER PIC X(006) VALUE 'AMBSR3'.
03 FILLER PIC X(006) VALUE 'AMBSR4'.
03 FILLER PIC X(006) VALUE 'AMBSR5'.
03 FILLER PIC X(006) VALUE 'AMBSR6'.
03 FILLER PIC X(006) VALUE 'AMBSR7'.
03 FILLER PIC X(006) VALUE 'AMBSR8'.
03 FILLER PIC X(006) VALUE 'AMBSR9'.
03 FILLER PIC X(006) VALUE 'AMBSRA'.
01 WS-AMBS-FILER REDEFINES WS-AMBS-FILE.
03 WS-FILE-READ OCCURS 10 INDEXED BY FILE-INDX.
05 AMBS-NAME PIC X(006).
01 WS-FS-AMBS.
03 FILLER PIC X(009) VALUE 'FS-AMBSR1'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR2'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR3'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR4'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR5'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR6'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR7'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR8'.
03 FILLER PIC X(009) VALUE 'FS-AMBSR9'.
03 FILLER PIC X(009) VALUE 'FS-AMBSRA'.
01 WS-FS-FILLER REDEFINES WS-FS-AMBS.
03 WS-FS-READ OCCURS 10 INDEXED BY FS-INDX.
05 AMBS-FS PIC X(009).
1200-READ-AMBS.
SET FILE-INDX TO 1
SET FS-INDX TO 1
MOVE AMBS-FS(FS-INDX) TO WS-AMBS-FS
MOVE AMBS-NAME(FILE-INDX) TO AMBSR WS-AMBS-NAME
IGYPS2074-S "AMBSR" was defined as a type that was invalid in this context. The statement was discarded.
OPEN INPUT AMBSR
IF FS-AMBSR NOT = ZEROES
DISPLAY 'NO SE PUEDE ABRIR AMBSR:' FS-AMBSR
MOVE 12 TO RETURN-CODE
STOP RUN
END-IF
I need to read several files (same data structure) so, I thoguht using an array and changing its index value it cpuld work
Does it make sense?
Regards |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Look into BPXWDYN -- it can be used in COBOL to dynamically allocate / free data sets. Read the specifications carefully, though, as it is NOT a simple thing to use. |
|
Back to top |
|
|
mmurilloa
New User
Joined: 31 May 2023 Posts: 2 Location: MEXICO
|
|
|
|
Robert Sample wrote: |
Look into BPXWDYN -- it can be used in COBOL to dynamically allocate / free data sets. Read the specifications carefully, though, as it is NOT a simple thing to use. |
Thanks a lot Robert.. I've implemented another solution..
Best Regards |
|
Back to top |
|
|
|