Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us