> -----Original Message----- > From: IBM Mainframe Discussion List > [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Scott Ford > Sent: Wednesday, December 07, 2011 9:46 PM > To: IBM-MAIN@bama.ua.edu > Subject: RECFM=VBA and no JCL > > All: > > I have the following situation: > > I am calling a program via Cobol and the output is > RECFM=VBA,LRECL=133,BLKSIZE=1330 (only an example) > The actual allocations are done dynamically via BPXWDYN and > work fine no problem. > I then close the file and free it and re-allocate it ( no JCL > ) for this file its dynamic and of course I can read it. > If I code a 'DD' with a RECFM=VB,LRECL=137 it works great > with no problems. I can I do the same internally inside my > Cobol code without a 'DD' stmt ? > > All comments and opinions are much appreciated. > Regards, > Scott J Ford > Software Engineer > http://www.identityforge.com
I don't really "get" what you want to do "without a DD". My guess is that you have a program which creates output, perhaps a lot of output. You then want to close out the output file and go to another "process" within the same program which reads the output that it generated itself. And you want to do this using I/O statements, as opposed to some sort of in-memory structure. Perhaps due to the number of bytes which would be consumed. I.e. you want a FIFO "scratch pad" area, accessable via I/O statements. For COBOL, you can indeed to this "without a DD statement" coded. The current Enterprise COBOL has the ability to dynamically allocate a DD statement for you. http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR50/4.2.3.1 . This is "instead of" using bpxwdyn. It does not truly eliminate the need for a DD. It just makes it "transparent to the user". Of course, there was a complete discussion of how to set an environment variable using COBOL. Example COBOL program doing dynamic allocation via environment variable, complete (but does not directly address the "scratch pad" issue). PROCESS ADV,AWO,NOC(W),DATA(31),DYN,FSRT,FLAG(I,I),NODYNAM PROCESS INTDATE(ANSI),LANG(EN),LIB,LIST,MAP,NAME(ALIAS) PROCESS NONUM,NUMPROC(PFD),OBJ,OPT(FULL),PGMNAME(COMPAT),APOST PROCESS RENT,RMODE(AUTO),NOSEQ,SOURCE,NOSSRANGE, PROCESS NOTERM,TEST(NONE,NOSYM),TRUNC(BIN),VBREF, PROCESS XREF(FULL),ZWB,FASTSRT,AR(E) ID DIVISION. PROGRAM-ID. 'DYNALLOC'. AUTHOR. JOHN MCKOWN. INSTALLATION. UICI LIFE INSURANCE CENTER. DATE-WRITTEN. DATE-COMPILED. SECURITY. NONE. * ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-370. OBJECT-COMPUTER. IBM-370. SPECIAL-NAMES. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT CONTROL-CARD ASSIGN TO DSNAME ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS CONTROL-CARD-FILE-STATUS-1. I-O-CONTROL. * APPLY WRITE-ONLY ON REPORT1-FD. * DATA DIVISION. FILE SECTION. * FD CONTROL-CARD BLOCK CONTAINS 0 RECORDS LABEL RECORDS ARE STANDARD RECORDING MODE IS F . 01 INPUT-CARD PIC X(80). * WORKING-STORAGE SECTION. 77 CONTROL-CARD-FILE-STATUS-1 PIC XX. 01 CEE3DMP-PARAMETERS. 05 CEE3DMP-TITLE PIC X(80) VALUE 'TEST DUMP'. 05 CEE3DMP-OPTIONS PIC X(255) VALUE 'NOTRACE NOENTRY'. 01 LE-FC. 02 CONDITION-TOKEN-VALUE. COPY CEEIGZCT. 03 CASE-1-CONDITION-ID. 04 SEVERITY PIC S9(4) BINARY. 04 MSG-NO PIC S9(4) BINARY. 03 CASE-2-CONDITION-ID REDEFINES CASE-1-CONDITION-ID. 04 CLASS-CODE PIC S9(4) BINARY. 04 CAUSE-CODE PIC S9(4) BINARY. 03 CASE-SEV-CTL PIC X. 03 FACILITY-ID PIC XXX. 02 I-S-INFO PIC S9(9) BINARY. * LOCAL-STORAGE SECTION. 77 RETURN-DATA PIC X(4). 01 ENV-DATA. 05 FILLER PIC X(11) VALUE 'DSNAME=DSN('. 05 DSN PIC X(110) VALUE IS LOW-VALUES. 01 P POINTER. 01 RC PIC S9(9) BINARY. 01 EOF-SWITCH PIC X VALUE IS LOW-VALUES. 88 EOF VALUE IS HIGH-VALUES. LINKAGE SECTION. 01 MVS-PARM. 05 MVS-PARM-LENGTH PIC S999 USAGE BINARY. 05 MVS-PARM-VALUE PIC X(120) . * PROCEDURE DIVISION USING MVS-PARM. START-UP. IF MVS-PARM-LENGTH > +100 THEN DISPLAY 'INPUT PARM TOO LONG > 100' UPON SYSOUT MOVE +8 TO RETURN-CODE STOP RUN END-IF MOVE MVS-PARM-VALUE(1:MVS-PARM-LENGTH) TO DSN(1:MVS-PARM-LENGTH) MOVE ') SHR' TO DSN(MVS-PARM-LENGTH + 1:5) MOVE LOW-VALUES TO DSN(MVS-PARM-LENGTH + 6:1) SET P TO ADDRESS OF ENV-DATA CALL 'PUTENV' USING BY VALUE P RETURNING RC IF RC > 0 THEN DISPLAY 'PUTENV FAILED RC=' RC UPON SYSOUT MOVE +8 TO RETURN-CODE STOP RUN END-IF OPEN INPUT CONTROL-CARD IF CONTROL-CARD-FILE-STATUS-1 NOT = 0 THEN DISPLAY 'CANNOT OPEN FILE RC=' CONTROL-CARD-FILE-STATUS-1 UPON SYSOUT MOVE +8 TO RETURN-CODE STOP RUN END-IF READ CONTROL-CARD AT END SET EOF TO TRUE END-READ PERFORM UNTIL EOF DISPLAY INPUT-CARD UPON SYSOUT READ CONTROL-CARD AT END SET EOF TO TRUE END-READ END-PERFORM GOBACK . END PROGRAM 'DYNALLOC'. -- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets® 9151 Boulevard 26 . N. Richland Hills . TX 76010 (817) 255-3225 phone . john.mck...@healthmarkets.com . www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets® is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company®, Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html