Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

cobol-ksds

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
nandini

New User


Joined: 27 Feb 2004
Posts: 18

PostPosted: Mon Mar 08, 2004 10:20 am    Post subject: cobol-ksds
Reply with quote

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
View user's profile Send private message

bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Mon Mar 08, 2004 2:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Tue Mar 09, 2004 3:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us