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: 2
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

Active Member


Joined: 15 Aug 2015
Posts: 905
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: 2
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: 1285
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: 8651
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: 1285
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: 8651
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: 8651
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: 1175
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 Change history of vsam file. JCL & VSAM 3
No new posts DASD - non SMS - volser change - VSAM... JCL & VSAM 2
No new posts dsnrexx fails without error message CLIST & REXX 9
No new posts Writing the output file name from a p... JCL & VSAM 7
No new posts vsam file access JCL & VSAM 12
Search our Forums:

Back to Top