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
 

 

VSAM-JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
raghu_4412
Warnings : 1

New User


Joined: 01 Mar 2004
Posts: 4
Location: Bangalore

PostPosted: Fri Mar 05, 2004 8:16 am    Post subject: VSAM-JCL
Reply with quote

Hello sir,

I am sending cobol program,complieJCL,runJCL & KSDS program.
In this
1) compile jcl the execution is successful i.e maxcc=0.
2)creation of KSDS cluster execution is successful i.e.maxcc=0.
3)RUNJCL EXECUTION IS SUCCESSFUL i.e. maxcc=0 but if i go & check in the spool message is file not opened with error no.37.
so that our i/p is not written to the KSDS file.

please give me solution how to remove the error & my data should written to KSDS file.


I) COBOL INDEXED FILE PROGRAM:

ID DIVISION.
PROGRAM-ID. FIWRITE.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE1 ASSIGN TO D1
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
RECORD KEY IS ID1
FILE STATUS IS FS.

DATA DIVISION.
FILE SECTION.
FD FILE1.
01 IN-REC.
02 ID1 PIC 999.
02 NAME1 PIC X(10).
02 FILLER PIC X(67) VALUE SPACES.

WORKING-STORAGE SECTION.
77 FS PIC XX.
77 PER PIC X VALUE 'Y'.

PROCEDURE DIVISION.
MAIN-PARA.
OPEN OUTPUT FILE1.
IF FS = 00
DISPLAY " FILE OPENED" FS
ELSE
DISPLAY " FILE NOT OPENED" FS.
PERFORM ACP-PARA UNTIL PER = 'N'.
CLOSE FILE1.
STOP RUN.
ACP-PARA.
ACCEPT ID1.
ACCEPT NAME1.
WRITE IN-REC.
ACCEPT PER.


II) COMPLILE JCL:


//ITES20S JOB CLASS=A,MSGCLASS=H,REGION=80M,MSGLEVEL= (1,1),
// NOTIFY=&SYSUID,PRTY=15
//COMPLINK EXEC PROC=IGYWCL
//COBOL.SYSIN DD DSN=ITES20.TCR.PGMKSDS(FINDWR),DISP=SHR
//LKED.SYSLMOD DD DSN=ITES20.RAGHU.LOAD(FINDWR2),DISP=SHR
//



III) KSDS PROGRAM:


//ITES20B JOB NOTIFY=&SYSUID,PRTY=15
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER -
( -
NAME(ITES20.TCR.KSDS6) -
VOLUMES(STD003) -
CYLINDERS(5,2) -
CONTROLINTERVALSIZE(4096) -
FREESPACE(10,20) -
KEYS(3,1) -
RECORDSIZE(80,80) -
) -
DATA(NAME(ITES20.TCR.DATA6)) -
INDEX(NAME(ITES20.TCR.INDEX6))
/*
//


IV) RUN-JCL PROGRAM:

//ITES20N JOB MSGCLASS=H,CLASS=A,MSGLEVEL=(1,1),NOTIFY=ITES20,
// PRTY=15
//STEP1 EXEC PGM=FINDWR2
//STEPLIB DD DSN=ITES20.RAGHU.LOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//D1 DD DSN=ITES20.TCR.KSDS6,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
100
RAGHU
Y
200
SACHIN
Y
300
SANJU
N
/*
//
[/url][/list][/list][/code][/quote]
Back to top
View user's profile Send private message

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Fri Mar 05, 2004 11:20 am    Post subject:
Reply with quote

Hello raghu_4412,

I think you will need to define your VSAM file once again with KEYS parameter as KEYS(3,0)

Hope this helps,

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
raghu_4412
Warnings : 1

New User


Joined: 01 Mar 2004
Posts: 4
Location: Bangalore

PostPosted: Sat Mar 06, 2004 9:19 am    Post subject: vsam-jcl
Reply with quote

sir,

I tried by changing key(3,0) still it is giving the same error
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Mar 06, 2004 10:03 pm    Post subject:
Reply with quote

Hi raghu,

I'm fairly sure that you can specify an OP file as SHR. In spit of that, try changing the disp for D1 to OLD. It's a good idea to do that anyway. You don't want someone else accessing your file while you're updating it.

Also,

although using IN-REC, etc. is permissable, it can be confusing to the reader (i.e. the maintainer of the code). It's a good idea to change all input data name refs to output.

Check the file status after every I/O includeing read/writes/close.

Regards, Jack.
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Mon Mar 08, 2004 5:01 pm    Post subject:
Reply with quote

you are passing input using sysin, it maybe a good idea to add
a configuration section to your pgm and do a single accept and then
parse results from accept into variables.
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Mon Mar 08, 2004 5:58 pm    Post subject:
Reply with quote

and then to run your JCL

Code:

//HH594DN JOB MSGCLASS=A,CLASS=A,MSGLEVEL=(1,1),NOTIFY=ITES20   
//STEP1 EXEC PGM=yourpgm                                         
//STEPLIB DD DSN=yourloadlib,DISP=SHR                   
//SYSPRINT DD SYSOUT=*                                         
//OUTFILE DD DSN=user.TCR.KSDS6,DISP=SHR                     
//SYSPRINT DD SYSOUT=*                                         
//SYSIN DD *                                                   
552name           2525696   
/*
Back to top
View user's profile Send private message
muthukumar

New User


Joined: 24 Mar 2004
Posts: 29

PostPosted: Wed Mar 24, 2004 3:17 pm    Post subject:
Reply with quote

hi

I guess you didnt initialize your ksds file before using it in the program..this should be the probable reason for that... if this is done the code must work fine.

regards
Muthu
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Wed Mar 24, 2004 5:34 pm    Post subject:
Reply with quote

The file is open for output so it should be ok.
I tested a load direct from a deldef step with a pgm that opened the ksds as output and it went thru ok.

If the file was open as I-O then you'll need one record in it.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts VSAM RLS=NRI while doing IDCAMS sheersh JCL & VSAM 1 Tue Mar 07, 2017 1:55 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm


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