IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

cobol-ksds


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top