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

Need to fetch data from database based on flags


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2455
Location: Hampshire, UK

PostPosted: Sun Sep 08, 2019 1:16 am
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: 1306
Location: Vilnius, Lithuania

PostPosted: Sun Sep 08, 2019 4:48 am
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

Global Moderator


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

PostPosted: Sun Sep 08, 2019 4:30 pm
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
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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Mon Sep 09, 2019 5:46 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Mon Sep 09, 2019 5:51 pm
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

Global Moderator


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

PostPosted: Mon Sep 09, 2019 9:10 pm
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: 2455
Location: Hampshire, UK

PostPosted: Tue Sep 10, 2019 1:52 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts What database does Jobtrac use CA Products 4
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top