MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Variable Length Record insertion to a GSAM

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
Siva Kumar Sunku
Beginner


Joined: 17 Aug 2004
Posts: 25
Topics: 14

PostPosted: Wed Sep 15, 2004 5:13 am    Post subject: Variable Length Record insertion to a GSAM Reply with quote

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
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Sep 15, 2004 5:54 am    Post subject: Reply with quote

Siva kumar sunku,

Check this link for a detailed explanation of status code VI. seems that there is mismatch of length definition on the DBD

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFSD20F3/E.2.2.138?SHELF=&DT=20020917080426&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Siva Kumar Sunku
Beginner


Joined: 17 Aug 2004
Posts: 25
Topics: 14

PostPosted: Wed Sep 15, 2004 6:29 am    Post subject: Reply with quote

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

RECORD=(2),

mean "My database can hold only maximum length of 2 bytes?"

Thanks
Siva.
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Sep 15, 2004 7:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group