View previous topic :: View next topic
|
Author |
Message |
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
I need to write in VB Member of a PDS, that contains teh decompiled ACF2 Rules.
The Propertied of PDS is :
Management class . . :INTERIM
Storage class . . . : BASE
Volume serial . . . : DMAS09
Device type . . . . : 3390
Data class . . . . . : DCDEFLT
Organization . . . : PO
Record format . . . : VB
Record length . . . : 255
Block size . . . . : 3665
1st extent tracks . : 6
Secondary tracks . : 14
Data set name type : PDS
When i am writing in a member of this PDS,
in JCL i am using
Code: |
//RULE DD DSN=T0084GK.RULETREE(RULE),DISP=MOD |
and in cobol file decleration is :
Code: |
DATA DIVISION.
FILE SECTION.
FD RULE
RECORDING MODE IS V
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS RUL-REC.
01 RUL-REC PIC X(255).
PROCEDURE DIVISION.
WRITE RUL-REC FROM NEW-RUL. |
i think i am missing some where
Thanks in Advance for any review: |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The FD looks inconsistent. . . V is specified, but only a fixed-length 01 is shown.
Why is DISP=MOD being used?
Is there any compiler error or abend? If yes, these need to be posted. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Record format . . . : VB
Record length . . . : 255 |
You also need to adjust your COBOL record length to account for the Block Descriptor Word -- your COBOL program should not use more than 251 bytes under the FD. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
@ dick scherrer :
There is no compiler error or abend.
the code is working fine.
DISP=MOD is used as the output file contains some records, ani i need to append a new record in that which is in 'NEW-RUL"
Also it is running in with RC 0, but not writting anything in the outpou, but delete all the records of the output File.
@ Robert Sample:
Will the below work???
DATA DIVISION.
FILE SECTION.
FD RULE
RECORDING MODE IS V
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS RUL-REC.
01 RUL-REC PIC X(251).
PROCEDURE DIVISION.
WRITE RUL-REC FROM NEW-RUL.
Thanks: |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
don't think you can't MOD a pds,
and have it work. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
DSN is used :
//RULE DD DSN=T0084GK.RULETREE(RULE),DISP=MOD
RULE is a member of the PDS whose properties is in above posts.
Cant we use MOD withmember of PDS?
Is there any other criticality writing VB Files.?
Thanks, |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
There is a link to manuals at the top of the page. The JCL Language Reference manual states:
Quote: |
12.19.8 Disposition of Partitioned Data Sets (PDSs and PDSEs)
When you specify DISP=MOD or DISP=NEW for a partitioned data set (PDS) or partitioned data set extended (PDSE), and you also specify a member name in the DSNAME parameter, the member name must not already exist. If the member name already exists, the system terminates the job. |
What you've got will work but if you're expecting records that vary in length, your code will not do that -- every record written to the file will be 251 bytes long.
Also, when using COBOL and having trouble with files, the file status field provides a lot of information. If you haven't used one before, the COBOL Language Reference manual (link at the top of the page) will tell you how to use it. Add one and let us know what the file status codes are for the open and the write statement. |
|
Back to top |
|
|
jignesh.rathod
New User
Joined: 03 Jan 2011 Posts: 1 Location: pune
|
|
|
|
Quote:
12.19.8 Disposition of Partitioned Data Sets (PDSs and PDSEs)
When you specify DISP=MOD or DISP=NEW for a partitioned data set (PDS) or partitioned data set extended (PDSE), and you also specify a member name in the DSNAME parameter, the member name must not already exist. If the member name already exists, the system terminates the job.
can anyone tell me why system terminates the job or can somebody provide me with relevent link.
also if any one can help me regarding appending data in pds member from another pds member or ps member. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
You should define a 01 record containing 255 bytes, but you have to define the first 4 bytes as the Block Descriptor Word and fill in the length of the data record to be written in the 2 first bytes (in binary).
You cannot append records to a PDS member. You will have to read the data to a temporary dataset, concatenate the new records, and write everything to the member in a new step. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Kjeld,
The 255 is the original question rather than the current question, i believe. . .
@jignesh rathod
Welcome to the forum,
When you have a question, you should start a new topic for your question rather than post a reply to some inactive topic as this can cause confusion.
Quote: |
can anyone tell me why system terminates the job or can somebody provide me with relevent link. |
Because this is the way partitioned datasets are designed to work. Why is not so important as knowing what can or cannot be done.
To do what you want, you should do as Kjeld suggests:
Quote: |
You cannot append records to a PDS member. You will have to read the data to a temporary dataset, concatenate the new records, and write everything to the member in a new step. |
|
|
Back to top |
|
|
|