View previous topic :: View next topic
|
Author |
Message |
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
I am writing a NEW program which reads Variable Block file, updates some fields by reading IMS database and writes in the same format.
But when I run the program the INPUT file field names are not coming in working storage properly and also OUTPUT file is writing in FB format though I am giving VB in the JCL.
Can anyone please let me know what could be the reason? The program is not abending but the data is coming wrong. Is it something that needs to do with PCB definition or coding. This is a BMP program.
Here is the program code. The layout DETAIL-MOVE-RECORD is working fine in another batch program with NO IMS.
input
CALL 'CBLTDLI' USING GN-FUNCTION,
FB0GS-PCB,
DETAIL-MOVE-RECORD.
output
CALL 'CBLTDLI' USING ISRT-FUNCTION
FB1GS-PCB
DETAIL-MOVE-RECORD.
PSB definition
PCB TYPE=GSAM,
NAME=FB0GSP,
PROCOPT=GS
PCB TYPE=GSAM,
NAME=FB1GSP,
PROCOPT=LS
JCL DD names.
//FB0GSP01 DD DSN=MYGDG.AC001(0),
// DISP=(OLD,KEEP,KEEP)
//FB1GSP01 DD DSN=MYGDG.AC002(+1),
// UNIT=TSTGRP,SPACE=(TRK,(225,75),RLSE),
// DISP=(NEW,CATLG,DELETE),
// DCB=GDGMODEL,RECFM=VB,LRECL=609,BLKSIZE=0,DSORG=PS,BUFNO=30)
//* |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
You forgot the most important... the dbd definitions...
compare the dbd definitions of the input and output databases,
and You might find out the why ( of the bad results ) |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Also - looks like you may be inserting a variable IMS database segment without length.
And....you cannot have your PROCOPT as load sequential if this is not a load program.
PCB TYPE=GSAM,
NAME=FB1GSP,
PROCOPT=LS |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
Sandy Zimmer wrote: |
Also - looks like you may be inserting a variable IMS database segment without length.
And....you cannot have your PROCOPT as load sequential if this is not a load program.
PCB TYPE=GSAM,
NAME=FB1GSP,
PROCOPT=LS |
So, can you please let me know what should be the PROCOPT for "Variable Length" file?
This is just a simple Batch READ and WRITE program. The main reason for writing in IMS is because I want a get a value from one of IMS DB segment. I did not put complete PSB here.
Here are some questions.
1. Can we READ "Variable Length" file in IMS program? If so, can you paste the code along with PCB definition. This code will work if I write in batch program as we put RECORD FORMAT VB in FD section. Is there any similar thing we need to do in IMS program?
2. Can we WRITE into "Variable Length" file in IMS program? If so, what would be PROCOPT and how do we code ISRT statement? My code is writing as FB.
If you have any example, I would appreciate putting the code here.
Thanks |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
You need to post your DBD for those databases. 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. Give us your code and your error code from your abend. |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
Sandy Zimmer wrote: |
You need to post your DBD for those databases. 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. Give us your code and your error code from your abend. |
I changed the program to access these files as usual COBOL batch by defining in FILE SECTION and putting RECORDING MODE as V. This way the program is Reading (OPEN READ CLOSE) and Writing (OPEN WRITE CLOSE) the files without any data issues. Still I am able to access IMS database to get the value. Now it is working good.
Its strange that IMS cannot handle "Variable Length" files. If we handle the length inside the program that does not make sense as the program itself should take care of it. As it is the case of above scenario "RECORDING MODE as V".
Thanks for your efforts on getting some information. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
I worked with variable IMS databases for MANY years - they work just fine. |
|
Back to top |
|
|
|