View previous topic :: View next topic |
Author |
Message |
Siva Kumar Sunku Beginner
Joined: 17 Aug 2004 Posts: 25 Topics: 14
|
Posted: Wed Sep 15, 2004 5:13 am Post subject: Variable Length Record insertion to a GSAM |
|
|
Hi,
Can anyone please provide sample code for inserting a record to a GSAM File. I have used the following.
Code: |
01 CHM-DBEX1-REC.
05 CHM-LENGTH PIC S9(04) COMP VALUE +9100.
05 CHM-DBEX1-REC-TYP PIC X(01) VALUE SPACE.
05 CHM-DBEX1-CONTENTS PIC X(9000).
.....
.....
CALL 'CBLTDLI' USING WS-FUNC-ISRT
PCB-EXT1-GSAM
CHM-DBEX1-REC
END-CALL
|
GSAM PCB is correct.
Currently the same piece is giving return Code 'V1'. I checked my DBD definitions and it is fine.
Can you please tell me whether I need to take care any thing in particular if I use Variable Length records for a GSAM.
Thanks
Siva. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Siva Kumar Sunku Beginner
Joined: 17 Aug 2004 Posts: 25 Topics: 14
|
Posted: Wed Sep 15, 2004 6:29 am Post subject: |
|
|
Kolusu,
Thanks for the reply. I checked the link.
when I checked my DBD definition I found the following.
Code: |
DSG001 DATASET DD1=DDBJPV01,
DD2=DDBJPV01,
SIZE=(0),
RECORD=(2),
RECFM=VB
DBDGEN
|
When I checked some help docs on the same I found the following
Code: |
Syntax for DBD
RECORD=(reclen1,reclen2)
RECORD=
reclen1 is the size of an LRECL length or
maximum size for a variable length record.
reclen2 is the minimum size for a variable
length record.
|
Here in my Database Definition does
mean "My database can hold only maximum length of 2 bytes?"
Thanks
Siva. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Sep 15, 2004 7:56 am Post subject: |
|
|
Siva kumar sunku,
Code: |
RECORD=(reclen1,reclen2)
|
For a GSAM database, reclen1 specifies the size of a logical record for a fixed-length record or the maximum size for a variable-length or undefined record. The value of reclen2 specifies the minimum size for a variable-length or undefined record.
In your DBD definition the reclen1 is defined as 2, so that will be the maximum size of the record.
Also remember that IMS adds 2 bytes to the record length value specified in the DBD in order to accommodate the ZZ field that is needed to make up the BSAM RDW. Whenever the database is GSAM/BSAM and the records are variable (V or VB), IMS adds 2 bytes. The record size of the GSAM database is 2 bytes greater than the longest segment that is passed to IMS by the application program.
so change your DBD definition.
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|