IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Read Variable Block file and Write Output in same format


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 52
Location: USA

PostPosted: Wed Nov 26, 2008 3:17 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 26, 2008 3:24 am
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Nov 26, 2008 3:47 am
Reply with quote

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
View user's profile Send private message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 52
Location: USA

PostPosted: Wed Nov 26, 2008 5:38 am
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Nov 26, 2008 5:41 am
Reply with quote

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
View user's profile Send private message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 52
Location: USA

PostPosted: Thu Nov 27, 2008 1:46 am
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Nov 27, 2008 3:43 am
Reply with quote

I worked with variable IMS databases for MANY years - they work just fine.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top