View previous topic :: View next topic
|
Author |
Message |
nandini
New User
Joined: 27 Feb 2004 Posts: 18
|
|
|
|
Hi friends,
i tried to input data into ksds dataset through cobol.But data is not entering ..Here the prog ..(foreground complie)
IDENTIFICATION DIVISION.
PROGRAM-ID. PGM01.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT EMPFILE ASSIGN TO OUTFILE
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS EMPNO
FILE STATUS IS FS.
DATA DIVISION.
FILE SECTION.
FD EMPFILE.
01 EMPREC.
02 EMPNO PIC 9(5).
02 NAME PIC X(15).
02 DNO PIC 9(2).
02 SAL PIC 9(5).
02 FILLER PIC X(53) VALUE ALL SPACES.
WORKING-STORAGE SECTION.
77 EOF PIC X VALUE 'Y'.
77 FS PIC X(2).
PROCEDURE DIVISION.
OP-PARA.
OPEN I-O EMPFILE.
PERFORM R-PARA UNTIL EOF = 'N'.
CLOSE EMPFILE.
STOP RUN.
R-PARA.
DISPLAY "EMPNO:".
ACCEPT EMPNO.
DISPLAY "NAME:".
ACCEPT NAME.
DISPLAY "DEPT NO:".
ACCEPT DNO.
DISPLAY "SALARY:".
ACCEPT SAL.
WRITE EMPREC.
DISPLAY "CONTINUE(Y/N):".
ACCEPT EOF. |
|
Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
hello,
can u also post the jcl you are using to input your data ?
DO YOU HAVE ANY RETURN CODES AFTER JOB RUN ?
CAN U POST YOUR vsam ksds DEFINITION ?
and you may want to post this in COBOL related thread as I'm not a cobol expert |
|
Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
hello,
first of all :
your open is I-O meaning that your outfile exists with data in it (data will be updated).
if you change to output your outfile needs be empty (data will be loaded)
also you need to code a special-names sub-section in your configuration section to be able to ACCEPT data from sysin (basically you can only accept from 'system variable' or special-names subsection)
Code: |
SPECIAL-NAMES.
SYSIN IS PGM-IN.
|
also when you ACCEPT DATA you can only accept into one varaible and parse into other variables.
I've modified your pgm to load or update (based on sysin) data from
infile to your outfile.
if intereted you can email me. |
|
Back to top |
|
 |
|