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

Write from flat file to db2 table


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Atul Baghresh
Warnings : 1

New User


Joined: 09 Mar 2022
Posts: 2
Location: India

PostPosted: Wed Mar 09, 2022 1:02 am
Reply with quote

Hi,

I have one sequential file with records:
Student id, Name, Class
01 Atul 5
02 Aman 6
03 Rahul 8

I want to read this flat file and put this data in DB2 table from COBOL.

Note: DB2 table have already column with student id, name and class.

Can you please suggest me logic to read file and insert record in db2 table?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Wed Mar 09, 2022 2:53 am
Reply with quote

The required logic of operations is as follows:

1. Read the input data into COBOL internal variables.

2. Insert the data from COBOL variables into a new DB2 table record.

That's it.
Back to top
View user's profile Send private message
Atul Baghresh
Warnings : 1

New User


Joined: 09 Mar 2022
Posts: 2
Location: India

PostPosted: Wed Mar 09, 2022 10:21 am
Reply with quote

Hi sergeyken,

Can you please explain the syntax for first step?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10884
Location: italy

PostPosted: Wed Mar 09, 2022 10:46 am
Reply with quote

simotime.com/sim4home.htm
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Wed Mar 09, 2022 6:18 pm
Reply with quote

Atul Baghresh wrote:
Hi sergeyken,

Can you please explain the syntax for first step?


I explained to you the LOGIC of operations, as you asked.

The forum is not a place to explain SYNTAX.

Syntax must be learned by reading manuals, and/or attending classes. In case any particular detail is not clear, you may ask the forum about this particular misunderstanding.

Furthermore, the "syntax explanation" in your understanding is equivalent to: "please, give me a ready-to-use solution, for me to copy-and-paste it into my project I am paid for".

This is NOT what this forum is supposed to be.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Wed Mar 09, 2022 9:45 pm
Reply with quote

locked. Please Google or read manuals how to code for READ and INSERT syntax.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Unload and Load ISPF Table TSO/ISPF 4
No new posts ISPF Table to add a new column TSO/ISPF 1
Search our Forums:

Back to Top