John,

I didn't realize that there could be two SELECTS that can reference the same 
DDNAME.



I learned something new, well everyday I learn something. I will give this a 
try.




Regards,

Scott Ford

www.identityforge.com





From: John McKown
Sent: ‎Monday‎, ‎February‎ ‎10‎, ‎2014 ‎1‎:‎06‎ ‎PM
To: IBM Mainframe Discussion List





I did a quick test. The simplest way was to simply have two SELECT
sentences which reference the same DD.

 FILE-CONTROL.
         SELECT FB ASSIGN TO UT-S-INPUT
                FILE STATUS IS FB-STATUS-1
                .
         SELECT VB ASSIGN TO UT-S-INPUT
                FILE STATUS IS VB-STATUS-1
                .
...
 FILE SECTION.
 FD   FB
      RECORD CONTAINS 80 CHARACTERS
      RECORDING MODE IS F
      BLOCK CONTAINS 0 RECORDS
      LABEL RECORDS ARE OMITTED
      .
 01  FB-RECORD.
     05 CARD-IMAGE       PIC X(80).
 FD  VB
     RECORDING MODE IS V
     RECORD IS VARYING IN SIZE
            FROM 1 TO 80 CHARACTERS
            DEPENDING ON VB-LRECL
     BLOCK CONTAINS 0 RECORDS
     LABEL RECORDS ARE OMITTED
     .
 01  VB-RECORD.
     05 CARD-COLUMN      OCCURS 1 TO 80 TIMES
        DEPENDING ON VB-LRECL
        PIC X(1).
...
PROCEDURE DIVISION.
...
     OPEN INPUT FB
     IF FB-FILE-STATUS-1 IS NOT 00 THEN
         OPEN INPUT VB
         IF VB-FILE-STATUS-1 IS NOT 00 THEN
              DISPLAY 'CANNOT OPEN INPUT FILE.'
              MOVE 8 TO RETURN-CODE
              GOBACK
         END-IF
    ENDIF
...
     IF FB-FILE-STATUS-1 IS ZERO THEN
         READ FB-RECORD
         MOVE FB-RECORD TO WS-RECORD
      ELSE
         READ VB-RECORD
         MOVE VB-RECORD (1:VB-LRECL) TO WS-RECORD
    END-IF
... process data in WS-RECORD



On Mon, Feb 10, 2014 at 5:16 PM, Scott Ford <scott_j_f...@yahoo.com> wrote:

> All:
>
>
> I have a Cobol program that can input either RECFM=FB or RECFM=VB and I am
> trying to make it easier for our customers to use.
>
> The input file can be either and whats the simplest way to tell the
> program that the input is FB OR VB. I was thinking PARM= …
>
>
> What do you guys/gals think ?
>
>
>
>
>
>
> Best Regards,
>
> Scott Ford
>
> www.identityforge.com
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 
Wasn't there something about a PASCAL programmer knowing the value of
everything and the Wirth of nothing?

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to