HP3000-L Archives

April 2002, Week 4

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:
"Shahan, Ray" <[log in to unmask]>
Reply To:
Shahan, Ray
Date:
Fri, 26 Apr 2002 15:08:20 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (101 lines)
        Given the question " Can I define the file I want to write to at RUN
Time. " .

        You can just write to a file, and MPE will create it if it does not
exist, however, it will create the file with an EOF of 10,000 records, so be
careful.  At the end of the run, you would need to SAVE the temporary file
you created (assuming you want it intact after job logs off).

        COBOL code
        FD MYFILE   ASSIGN TO "TEMPFILE"

        MPE command
        RUN MYPROG

        MPE command
        SAVE TEMPFILE


        Ray Shahan

> -----Original Message-----
> From: Duane Percox [SMTP:[log in to unmask]]
> Sent: Friday, April 26, 2002 2:58 PM
> To:   [log in to unmask]
> Subject:      Re: Cobol Buffer Limits and Cobol Dynamic Filenaming
>
> 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 *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2