Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to fetch data from database based on flags

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Satandale

New User


Joined: 07 Sep 2019
Posts: 2
Location: India

PostPosted: Sun Sep 08, 2019 12:01 am    Post subject: Need to fetch data from database based on flags
Reply with quote

Hello,
I want to read certain data from database base on the flags in input file which contains data like NYYYN...... UPTO 12 TIMES.

Second file which contains number of records with keys. Based upon on these keys retrieving data from database which can contain multiple entries for single or multiple members which satisfy the flag indicators values.

Then want to write these data into second file from position 1276 onwards iteratively for these 12 flag indicators. Here all flag entries contains value of 150 bytes.

Can some one please advise how it can be achieved.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2247
Location: Hampshire, UK

PostPosted: Sun Sep 08, 2019 1:16 am    Post subject: Reply to: Need to fetch data from database based on flags
Reply with quote

Your explanation is not at all clear to me. Perhaps you could provide some sample inputs and outputs.

Really, you should try first and then ask questions regarding specific problems you have with your code.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1163
Location: Vilnius, Lithuania

PostPosted: Sun Sep 08, 2019 4:48 am    Post subject: Re: Reply to: Need to fetch data from database based on flags
Reply with quote

Nic Clouston wrote:
Your explanation is not at all clear to me. Perhaps you could provide some sample inputs and outputs.

You mean it's as clear as mud. What the fecking 'ell is this (self-censored) doing on a forum for experts???
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2300
Location: NY,USA

PostPosted: Sun Sep 08, 2019 4:30 pm    Post subject:
Reply with quote

Quote:
Can some one please advise how it can be achieved?

Write a Cobol-Db2 program, that’s the best solution based on the complex info provided.
If you need better answers then explain the requirements in much simpler way that anyone can understand without making no assumptions.
Back to top
View user's profile Send private message
Satandale

New User


Joined: 07 Sep 2019
Posts: 2
Location: India

PostPosted: Mon Sep 09, 2019 3:14 pm    Post subject: Reply to: Need to fetch data from database based on flags
Reply with quote

Missed to add the information about the input and output.

Input:
Input is retrieved from database

I'd. First. Last. COB. Effective. Userid
Name. Name. Indc. Date

123456789 Alexa Martin Cs. 2019-01-01. Abc
123456789 Alexa. Martin. Cp. 2019-03-01. Xyz
123456789 Alexa. Martin. Ms. 2019-02-01. Xyz
234567891 Roti. Senti. Mp. 2019-01-01. Abc


Output:
Want to write in PS dataset as like below:

123456789 Alexa Martin Cs. 2019-01-01. Abc. Cp. 2019-03-01. Xyz. Ms. 2019-02-01. Xyz
234567891 Roti. Senti. Mp. 2019-01-01. Abc


Please be advise on this.
If anything missing please let me know.


Thanks,
Satandale
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 610
Location: Maryland

PostPosted: Mon Sep 09, 2019 5:46 pm    Post subject: Re: Reply to: Need to fetch data from database based on flags
Reply with quote

Satandale wrote:
Missed to add the information about the input and output.

Input:
Input is retrieved from database

I'd. First. Last. COB. Effective. Userid
Name. Name. Indc. Date

Code:
123456789 Alexa     Martin      Cs.       2019-01-01.      Abc
123456789 Alexa.    Martin.     Cp.       2019-03-01.      Xyz
123456789 Alexa.    Martin.     Ms.      2019-02-01.      Xyz
234567891 Roti.       Senti.       Mp.      2019-01-01.      Abc


Output:
Want to write in PS dataset as like below:

Code:
123456789 Alexa     Martin      Cs.       2019-01-01.      Abc.   Cp.       2019-03-01.      Xyz.    Ms.    2019-02-01.   Xyz
234567891 Roti.       Senti.       Mp.      2019-01-01.      Abc


Please be advise on this.
If anything missing please let me know.

0) Did you ever hear/see so called "code tags"?

1) How all above is related to the original?
Quote:
the flags in input file which contains data like NYYYN...... UPTO 12 TIMES.


2) Can this output "string"/"record"/"row" be of unlimited size??? Do you plan to print it on paper of unlimited width? What is the planned use of this endless line?
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 610
Location: Maryland

PostPosted: Mon Sep 09, 2019 5:51 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
Write a Cobol-Db2 program, that’s the best solution based on the complex info provided.

This statement is under a very big question.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2300
Location: NY,USA

PostPosted: Mon Sep 09, 2019 9:10 pm    Post subject:
Reply with quote

sergeyken wrote:
Rohit Umarjikar wrote:
Write a Cobol-Db2 program, that’s the best solution based on the complex info provided.

This statement is under a very big question.

Its is not based on what TS had said in the original post.
Quote:
I want to read certain data from database base on the flags in input file which contains data like NYYYN...... UPTO 12 TIMES.


Let me save time and future locking of this another post because of the arguments that you put in, If you have any questions about what I say then PM me.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2247
Location: Hampshire, UK

PostPosted: Tue Sep 10, 2019 1:52 am    Post subject: Reply to: Need to fetch data from database based on flags
Reply with quote

This topic is under "COBOL Programming" so obviousy a COBOL program is required. What has not been specified is the DBRM. It could be DB2 but it might be IMS and yet again it could be IDMS. Those are the most common - others may be available! May the OP (topic starter) inform us of the DBRM in use?
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extract data from n DB2 Views automat... esmeraldo All Other Mainframe Topics 5 Wed Nov 13, 2019 12:32 am
No new posts adrdssu for copy all data robyjhl JCL & VSAM 5 Tue Nov 12, 2019 11:17 pm
No new posts Convert mainframe data to .csv format... karan_reddy DFSORT/ICETOOL 10 Sat Nov 02, 2019 2:09 am
No new posts How to place name of the file where t... danielgp89 SYNCSORT 18 Thu Oct 17, 2019 12:55 am
No new posts How to force ISPF to allocate ISPF te... Michele Giannuli TSO/ISPF 9 Thu Sep 12, 2019 2:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us