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 

IMS/DB - why the length is not written to o/p file?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Nov 28, 2006 1:10 am    Post subject: IMS/DB - why the length is not written to o/p file? Reply with quote

Hi,

I came across a IMS-DB2-COBOL program in our installation. I could understand it. This program uses same file layout for both input and output files (both are GSAM files).

The Working-Storage section entry:

Code:

01  O-EXTRACT-01.                         
COPY xxxxxx57 REPLACING ==:TAG:== BY ==O==.


The output structure is like this:

Code:

05 O-EXTRACT-AREA.                           
   10 O-xxx-LENGTH            PIC S9(04) COMP.
   10 O-xxxx-xx-NBR           PIC X(04).     
   10 O-xxxxxx-xxx-CD         PIC X(02).     
   10 O-xx-xxxxxG-KEY         PIC X(03).     
   10 O-xxx-xxxxR-NBR         PIC X(10).     
   10 O-xxx-xxxE-CD           PIC X(01).     


This structure is written to the output file like this:

Code:

MOVE LENGTH OF O-EXTRACT-01   TO O-xxx-LENGTH
                                             
CALL 'CBLTDLI' USING C-IMS-ISRT             
                     L-IMSDGVB1-PCB         
                     O-EXTRACT-01           
END-CALL                                     


If I look at the output file, it never shows the first two bytes (O-xxx-LENGTH) field at all and starts from the next field only. Why?

Please explain.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Nov 28, 2006 5:47 am    Post subject: Reply with quote

mf_user,

Check and see if the output file is a VB file

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Apr 06, 2012 6:08 am    Post subject: reopening Reply with quote

Hi Kolusu, I am sorry to ask this question on this topic after many years Shocked

Yes.......a VB file is first initialized and then passed on to IMS-DB2-COBOL program to write output records.

Please explain this concept.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Mon Apr 09, 2012 8:17 am    Post subject: Reply with quote

If you are inserting to a database defined with variable length segments, you always need to calculate the length of the segment and insert it along with everything else.

In VB files, first 4-bytes are reserved for RDW and in its basic sense underline files are still physical sequential files, GSAM is just an access mehtod, so you need to write the length too.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu Apr 19, 2012 6:12 am    Post subject: thx Reply with quote

thanks a lot Anuj.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
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