.How to add one input & one Out file in existing cobol
program.
how approach tell me step by step.
Answer Posted / nimsatprasad
IDENTIFICATION DIVISION.
PROGRAM-ID. ADDFILES.
AUTHOR. PRASAD.
DATE-WRITTEN. 2007/07/26.
DATE-COMPILED. 2007/07/26.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
SPECIAL-NAMES.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INPUT-FILE1 ASSIGN TO INPUT1
FILE STATUS IS WS-INPUT1-STATUS.
SELECT INPUT-FILE2 ASSIGN TO INPUT2
FILE STATUS IS WS-INPUT2-STATUS.
* HERE INPUT-FILE2 IS NEWLY ADDED
SELECT OUTPUT-FILE1 ASSIGN TO OUTPUT1
FILE STATUS IS WS-OUTPUT1-STATUS.
SELECT OUTPUT-FILE2 ASSIGN TO OUTPUT2
FILE STATUS IS WS-OUTPUT1-STATUS.
* HERE OUTPUT-FILE2 IS NEWLY ADDED
DATA DIVISION.
FILE SECTION.
FD INPUT-FILE1
RECORD CONTAINS 71 CHARACTERS
RECORDING MODE IS F
DATA RECORD IS XXX-RECORD.
01 INPUT-REC1 PIC X(71).
FD INPUT-FILE2
RECORD CONTAINS 71 CHARACTERS
RECORDING MODE IS F
DATA RECORD IS YYY-RECORD.
01 INPUT-REC2 PIC X(71).
* NEWLY ADDED FD.
FD OUTPUT-FILE1
RECORD CONTAINS 71 CHARACTERS
RECORDING MODE IS F
DATA RECORD IS AAA-RECORD.
01 OUTPUT-REC1 PIC X(71).
FD OUTPUT-FILE2
RECORD CONTAINS 71 CHARACTERS
RECORDING MODE IS F
DATA RECORD IS BBB-RECORD.
01 OUTPUT-REC2 PIC X(71).
* NEWLY ADDED FD.
WORKING-STORAGE SECTION.
--
--
--
PROCEDURE DIVISION.
...
...
...
THE BELOW INFORMATION ALSO IS USEFUL FOR THE DECLERATION.
Fixed Block File
• Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE
IS F, BLOCK CONTAINS 0.
Fixed Unblocked
• Use ORGANISATION IS SEQUENTIAL. Use RECORDING
MODE IS F, do not use BLOCK CONTAINS
Variable Block File
• Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE
IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record
length in FD i.e. JCL REC length will be max REC length
in PGM + 4
Variable Unblocked
• Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE
IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for
record length in FD i.e. JCL REC length will be max REC
length in PGM + 4.
ESDS VSAM file
• Use ORGANISATION IS SEQUENTIAL.
KSDS VSAM file
• Use ORGANISATION IS INDEXED, RECORD KEY IS,
ALTERNATE RECORD KEY IS
RRDS File
• Use ORGANISATION IS RELATIVE, RELATIVE KEY IS
Printer File
• Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE
IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).
*** IF ANY THING WORNG REGARD THIS LET ME KNOW, THANKS.
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is the difference between comp and comp-3 usage?
Have you used comp and comp-3 in your project? And how?
Describe the cobol database components?
How do you reference the following file formats from cobol programs?
Explain about different table spaces.
What is the difference between structured cobol programming and object alternativelyiented cobol?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
What rules are to be followed while using the corresponding options?
What are the cobol coding sheets?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
What are the different rules of SORT operation?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?