Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Read Variable Block file and Write Output in same format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 47
Location: USA

PostPosted: Wed Nov 26, 2008 3:17 am    Post subject: Read Variable Block file and Write Output in same format
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10234
Location: italy

PostPosted: Wed Nov 26, 2008 3:24 am    Post subject: Reply to: Read Variable Block file and Write Output in same
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    Post subject:
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: 47
Location: USA

PostPosted: Wed Nov 26, 2008 5:38 am    Post subject: Read Variable Block file and Write Output in same
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    Post subject:
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: 47
Location: USA

PostPosted: Thu Nov 27, 2008 1:46 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us