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

writing into VSAM indexed tabl in PL1 with error oncode 1011


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
futohomok

New User


Joined: 25 Aug 2022
Posts: 7
Location: hungary

PostPosted: Thu Aug 25, 2022 1:07 pm
Reply with quote

Hi people of Mainframe world! I search an resolve for next problem:
I like writing a record to indexed VSAM table in PL1. The 'OPEN' statement is executed without error. End the next statement is a 'WRITE' which is executed with Oncode ERROR 1011. Please send me any words about resolving this problem. Details:

DCL RWOUVS FILE RECORD DIRECT OUTPUT KEYED ENV(VSAM);

OPEN FILE(RWOUVS);
AREA = '0000000010A boldogsag kek madara';
KSKEY = '0000000010';

WRITE FILE(RWOUVS) FROM(AREA) KEYFROM(KSKEY);

JCL script:

//GO.RWOUVS DD DSN=PL1.RWVSOU,DISP=MOD

//OUVSCR EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER (-
NAME(PL1.RWVSOU) -
RECORDS(100 50) -
INDEXED -
KEYS(10 0) -
RECORDSIZE(80 80))
/*
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Thu Aug 25, 2022 1:11 pm
Reply with quote

You know that using the Code Tag button will give you much better chances that your question is read, right? Also IDCAMS is not JCL, neither it is a Script.
Back to top
View user's profile Send private message
futohomok

New User


Joined: 25 Aug 2022
Posts: 7
Location: hungary

PostPosted: Thu Aug 25, 2022 1:45 pm
Reply with quote

Dear Joerg, very thanx for your answer! I'm afraid from worst but hoping for a good solution. Well, I don't know what is 'Code Tag'. For this please excuse me my defect. And my query is not solved. Please help me to find the solution of problem

best regard
Gyozo
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Aug 25, 2022 6:16 pm
Reply with quote

Long time since I used VSAM in PL/I, but I seem to remember that it was required to initialise VSAM files before use.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 25, 2022 6:26 pm
Reply with quote

When you start a topic or reply to one, there are various buttons above the reply box to set attributes (B for bold, i for italic, etc). One of those buttons is Code. Click it, paste your code, then click it again if there's not a [/code] at the end of what you pasted. Code mode preserves spacing and uses a fixed-width font -- both of which are better for code.

What message(s) did you get in your job output? Usually if there's a file error, there is some sort of message provided by the operating system.

Try making sure that AREA is 80 bytes -- one possible error would be that you're not writing 80 bytes to the VSAM data set. And, by the way, AREA is a REALLY BAD name for a PL/I variable since AREA is used in PL/I for a condition and an attribute.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Aug 25, 2022 6:54 pm
Reply with quote

Robert Sample wrote:
And, by the way, AREA is a REALLY BAD name for a PL/I variable since AREA is used in PL/I for a condition and an attribute./quote]
And that's the good thing about PL/I, because there are no keywords, no program will ever fail to (re-)compile when the language is changed.[

As for using AREA, 99.99% of users of PL/I won't even know it exists, let alone how useful it is, especially now that the "ALLOC()" builtin can include an area as the second parameter, and the "NEXTALLOC()" can inline the code to make allocations inside an area. Both were suggested by my and potentially make processing list and tree structures a hell of a lot faster.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 25, 2022 7:39 pm
Reply with quote

Quote:
I seem to remember that it was required to initialise VSAM files before use.
Only for INPUT or I/O modes -- when using OUTPUT, the VSAM does not need to be initialized.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 25, 2022 7:39 pm
Reply with quote

Quote:
I seem to remember that it was required to initialise VSAM files before use.
Only for INPUT or I/O modes -- when using OUTPUT, the VSAM does not need to be initialized.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Aug 25, 2022 8:33 pm
Reply with quote

I'd be inclined to follow steps suggested by:

www.ibm.com/docs/en/zos/2.3.0?topic=messages-ibm0811s

It takes more than the oncode to determine the cause of the failure.

Garry.
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top