Subject: | |
From: | |
Reply To: | |
Date: | Fri, 26 Apr 2002 12:57:57 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Mary asks some questions:
>1. My COBOL program needs to interface with this
> external software and read certain Objects.
> Currently it is all working with a CALL statement
> But the data read is being read into a 1k Buffer.
>
> call SOMECALLABLE
> using My-BUFFER and other parameters.
>
>
> where
> 01 My-BUFFER PIC X(1024).
>
> But the test scenario might most likely be,
> a 1 meg or 2 or 4 MEG.
>
> can I define
> 01 MY-BUFFER PIC (40001024).
You can easily define a pic with 4mb or even ~ 39mb as
your example indicates (4mb == 4,194,304; 40mb = 41,943,040).
The size of your nmprg is influenced by the amount of working
storage so don't make it much more than you really need or you
will get a huge binary which will take a long time to load.
> Issue #2:
> Can I define the file I want to write to at
> RUN Time. Again COBOL.
> Or is the FILE my COBOL code would write to
> is fixed at COMPILE TIME as defined in the
> FD and FILE SECTION.
You have 3 choices here.
a. SELECT MY-FILE ASSIGN TO "MYFILE".
Prior to running your program issue a file equation
which equates FILE to your file of choice.
For example:
:FILE MYFILE = XFILE
b. Use the same 'select', but programmatically issue a file
equation in your program prior to opening the file.
c. SELECT MY-FILE ASSIGN USING WS-FILE-NAME.
In working storage define a variable WS-FILE-NAME and
prior to opening the file move your filename into this
variable.
01 WS-FILE-NAME PIC X(30) VALUE SPACES.
...
DISPLAY "File to use?" WITH NO ADVANCING.
ACCEPT WS-FILE-NAME.
OPEN INPUT MY-FILE.
Be sure to use either the 'optional' phrase in the 'select'
or assign a 'file status' variable to the file so you can check
status on the file existing. Otherwise your program will crash
when doing the open.
Duane
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|