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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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