View previous topic :: View next topic
|
Author |
Message |
futohomok
New User
Joined: 25 Aug 2022 Posts: 7 Location: hungary
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Active Member

Joined: 15 Aug 2015 Posts: 971 Location: Bamberg, Germany
|
|
|
|
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 |
|
 |
futohomok
New User
Joined: 25 Aug 2022 Posts: 7 Location: hungary
|
|
|
|
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 |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1292 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8671 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1292 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8671 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8671 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1179 Location: Dublin, Ireland
|
|
Back to top |
|
 |
|