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

Fetch some value based on another value from a VB rec file


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sandip Mallick

New User


Joined: 02 Jun 2022
Posts: 5
Location: India

PostPosted: Thu Mar 02, 2023 5:46 pm
Reply with quote

I have a file of variable length from where I want to fetch a particular field for each record after a specific field. How can I achieve this using Cobol Program.

For example : the two records in a VB file looks like

POL :123456 CLIENT NAME : ROB PARKER PREMIUM DUE DATE: FEB, 13, 23
POL :678844 CLIENT NAME : S PETER PREMIUM DUE DATE: JAN, 04, 23

My requirement is to fetch the date for rec1 FEB, 13, 23 & for rec2 JAN, 04,23 after the constant field name PREMIUM DUE DATE.

How to achieve this in a COBOL program.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Thu Mar 02, 2023 5:56 pm
Reply with quote

Sandip Mallick wrote:

How to achieve this in a COBOL program.


Required steps are as follows:

1. Read a number of manuals and guides on COBOL

2. Train yourself with multiple examples on data processing using COBOL

3. Learn something about Joining Records algorithms

4. Write a code in COBOL to perform record joining specific to your case

5. Debug your code using test input data

6. Bingo! Your job is done!


P.S.
Much more simple solution would be: using DFSORT/SYNCSORT utility for this routine task
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Mar 03, 2023 4:46 am
Reply with quote

Moved to Beginners section, please refer the manuals or sample existing programs in your shop.
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 -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
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
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top