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
 

 

File processing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
vishwakotin

New User


Joined: 15 Mar 2017
Posts: 9
Location: India

PostPosted: Fri Apr 28, 2017 11:38 am    Post subject: File processing
Reply with quote

Hi, I have attended one of the interview where he asked to write JCL for the below.

There is a KSDS file and a DB2 table. He want read the file and a table, if the record is not in table then insert, if the record is in table update and if the record is not in file then delete from table. I said we can write COBOL module to do it but he is expecting something else do we have any other way to do it.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1800
Location: UK

PostPosted: Fri Apr 28, 2017 2:25 pm    Post subject:
Reply with quote

You could have told him that z/OS uses data sets not files and that JCL does not manipulate data. JCL lets the system know that you want to run some programs, the order they are to run in and what resources are required by each program.
Back to top
View user's profile Send private message
vishwakotin

New User


Joined: 15 Mar 2017
Posts: 9
Location: India

PostPosted: Fri Apr 28, 2017 3:03 pm    Post subject: Reply to: File processing
Reply with quote

Can this be done by REXX or stored procs? Because he was asking any option other than COBOL.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1800
Location: UK

PostPosted: Fri Apr 28, 2017 3:39 pm    Post subject:
Reply with quote

Any programming language that supports DB2 - PL/1, Rexx, C, Assembler etc
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Fri Apr 28, 2017 5:16 pm    Post subject: Reply to: File processing
Reply with quote

Quote:
if the record is not in table then insert, if the record is in table update and if the record is not in file then delete from table.

given the wording the db2 table would simply mirror the KSDS,
so no programming needed, just a smart use of the utilities

drop the table
repro the KSDS to a PS dataset
reload the table
Back to top
View user's profile Send private message
Anoop Chandran1984

New User


Joined: 14 Oct 2015
Posts: 5

PostPosted: Fri Apr 28, 2017 7:50 pm    Post subject:
Reply with quote

Enrico,
What about the existing table data from other sources ?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 376
Location: USA

PostPosted: Fri Apr 28, 2017 8:01 pm    Post subject: Reply to: File processing
Reply with quote

Quote:
drop the table

You mean Unload?

Anoop Chandran1984, What Other Sources? You didn't mention that in the question.

.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Fri Apr 28, 2017 8:09 pm    Post subject: Reply to: File processing
Reply with quote

Quote:
What about the existing table data from other sources ?


given the text of the question there are no other data sources

REquoting
Quote:
if the record is not in table then insert, if the record is in table update and if the record is not in file then delete from table.


and ... why the unload, given the extent of the question it is not needed
Back to top
View user's profile Send private message
Anoop Chandran1984

New User


Joined: 14 Oct 2015
Posts: 5

PostPosted: Fri Apr 28, 2017 8:20 pm    Post subject:
Reply with quote

Rahul31,

I'm not the original poster and was just reading and curious.

Yes,I think "unload" and then you would have remove the duplicate data between this unload and the PS data set(need to keep the PS data not unload for matching data).

Then the reload would work.
Back to top
View user's profile Send private message
Anoop Chandran1984

New User


Joined: 14 Oct 2015
Posts: 5

PostPosted: Fri Apr 28, 2017 8:29 pm    Post subject:
Reply with quote

ok..

Re reading the question
Quote:
if the record is not in file then delete from table.
I now think we need not worry about the existing data.They have to be deleted if they are not in KSDS

So I think Enrico's solution is all that's needed.Thanks Enrico.
Back to top
View user's profile Send private message
vishwakotin

New User


Joined: 15 Mar 2017
Posts: 9
Location: India

PostPosted: Tue Jun 06, 2017 5:47 pm    Post subject:
Reply with quote

Yes, It is bit tricky. that would work. got this answer when I was sleeping icon_smile.gif. Thought of updating it and some one got the answer already!!!!
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Tue Jun 06, 2017 8:33 pm    Post subject:
Reply with quote

Quote:
Yes, It is bit tricky
what is it so tricky to REPRO and load.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 376
Location: USA

PostPosted: Tue Jun 06, 2017 11:40 pm    Post subject:
Reply with quote

vishwakotin wrote:
Yes, It is bit tricky. that would work. got this answer when I was sleeping :). Thought of updating it and some one got the answer already!!!!

Since you already got the answer, all I can say now is that.. You had a really long sleep.. from Apr 28 to Jun 06..

.
Back to top
View user's profile Send private message
vishwakotin

New User


Joined: 15 Mar 2017
Posts: 9
Location: India

PostPosted: Fri Jun 09, 2017 2:30 pm    Post subject:
Reply with quote

Quote:

Since you already got the answer, all I can say now is that.. You had a really long sleep.. from Apr 28 to Jun 06..


I was watching this post and no quick resolutions, hence I though interviewer asked something which is not possible, hence never logged in. I know you might be bit jealous that you did not get the answer, by the way you responded icon_smile.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Fri Jun 09, 2017 7:52 pm    Post subject:
Reply with quote

Quote:
I was watching this post and no quick resolutions,
I must say you are not paying attention to the replies given to you. Reread all the replies.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP xls file from Mainfrmae kumarsatheeshc1 TSO/ISPF 5 Tue Jun 20, 2017 6:56 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts XML Parse for large file muralikrishnan_new COBOL Programming 3 Mon Jun 12, 2017 12:50 pm


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