View previous topic :: View next topic |
Author |
Message |
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Tue Nov 28, 2006 1:10 am Post subject: IMS/DB - why the length is not written to o/p file? |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Apr 06, 2012 6:08 am Post subject: reopening |
|
|
Hi Kolusu, I am sorry to ask this question on this topic after many years
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 |
|
|
Anuj Dhawan Intermediate
Joined: 19 Jul 2007 Posts: 298 Topics: 7 Location: Mumbai,India
|
Posted: Mon Apr 09, 2012 8:17 am Post subject: |
|
|
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 |
|
|
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Thu Apr 19, 2012 6:12 am Post subject: thx |
|
|
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 |
|
|
|
|