HP3000-L Archives

October 1999, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Doug Werth <[log in to unmask]>
Reply To:
Doug Werth <[log in to unmask]>
Date:
Thu, 21 Oct 1999 09:13:52 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (75 lines)
You can do this with just COBOL, no intrinsic calls required. COBOL allows
you to override the default number of records in a file in the ASSIGN to
clause of the SELECT statement. It also lets you assign a dynamic file name
with the USING clause of the SELECT statement.
Here is a sample program.

I suspect you are writing programs that run under Apache so file equations
won't work because they apply to the entire job, they are not specific to
the current process. Even if you BUILD the file first with the [HP]CICOMMAND
intrinsic you still must override the file name.

HTH.

Doug.

Doug Werth                             Beechglen Development Inc.
[log in to unmask]                               Cincinnati, Ohio

The opinions expressed do not  necessarily represent the views or
opinions of Beechglen Development. They might but not necessarily.
They represent solely the opinions of the author.

001100 IDENTIFICATION DIVISION.
001200 PROGRAM-ID. COBTEST.
001300 ENVIRONMENT DIVISION.
001400 CONFIGURATION SECTION.
001500 SPECIAL-NAMES.
001600     CONDITION-CODE IS C-C.
001700 INPUT-OUTPUT SECTION.
001800
001900 FILE-CONTROL.
002000     SELECT FILE1 ASSIGN TO "TEST,,,,55000" USING DYNAMIC-NAME.
002100 I-O-CONTROL.
002200 DATA DIVISION.
002300 FILE SECTION.
002400 FD FILE1.
002500 01 FILE1-RECORD PIC X(80).
002600
002700 WORKING-STORAGE SECTION.
002800 01 PROGRAM-NAME PIC X(26) VALUE SPACES.
002900
002902 01 DYNAMIC-NAME     PIC X(16) VALUE "FILENAME".
003000 PROCEDURE DIVISION.
003100 0000-CONTROL-PROCESS.
003300     MOVE "MYFILE" TO DYNAMIC-NAME.
003400     OPEN OUTPUT FILE1.
003500     CLOSE FILE1.
003600     STOP RUN.

:run cobtest
:listftemp,2

FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----
                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX

MYFILE             80B  FA           0      55000   3        0  0  * (TEMP)


----- Original Message -----
From: SCastle <[log in to unmask]>
To: <[log in to unmask]>
Sent: Thursday, October 21, 1999 8:13 AM
Subject: Intrinsic Functions


> Is there any way using an HP intrinsic to build a file within a COBOL
> program?  I ask because the temporary file that is created by COBOL under
> MPE only allows 10,000 records.  I need to bump this number up, but I
> haven't been able to come up with a way to solve this problem.
>
> I know I can create the file using a build statement, but I'm creating the
> file with a different name every time at run-time, so I need to do the
> build within the COBOL program.
>

ATOM RSS1 RSS2