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
 

 

Interview Questions

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

New User


Joined: 23 Mar 2005
Posts: 25

PostPosted: Thu Aug 11, 2005 1:45 pm    Post subject: Interview Questions
Reply with quote

Please give me the solution for the following questions.

1) ESDS dataset contains 100 records, in that I want to UPDATE from 80th record to 90th how we will do.
2. KSDS dataset contains 100 records, in that I want to UPDATE from 80th record to 90th how we will do.
3) How to retrieve duplicate rows from a particular table?
4) How do rename set of files in one shot?
5) In a file 50 records are there, I want the records from 50th byte to 80th byte. How can i get it?

Thanks in advance,
Keerthi.
Back to top
View user's profile Send private message

thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Thu Aug 11, 2005 2:39 pm    Post subject:
Reply with quote

2)

access mode is dynamic

you can move 80 to key field

Start filename key = key field invalied key display "invalied key" gp to a.
read filename next

check

if keyfield < 91

all the statements for update

else
go to a.

thanks,
thanooz
Back to top
View user's profile Send private message
Gops

New User


Joined: 21 Jul 2005
Posts: 23

PostPosted: Wed Aug 17, 2005 5:27 pm    Post subject: Re: Interview Questions
Reply with quote

Hi keerthi

5) In a file 50 records are there, I want the records from 50th byte to 80th byte. How can i get it?

This question is not so clear,still what I guess that you want to have all 50 records from 50th to 80 bytes into another file.

If my guess is right then it can done using sort utility as shown.

//ABCD JOB
//STEP0030 EXEC PGM=SORT,
//SORTIN DD DSN=YOUR I/P DATASET,DISP=SHR
//SORTOUT DD DSN=YOUR O/P DATASET,DISP=SHR
//SYSOUT DD DSN=&HLQ1..&JOBNME..&PROCNME..SORTLOG,DISP
//SYSIN DD *
SORT FIELDS=(50,30,CH,A) ===> WILL SORT THE CHARACTERS FROM 50 TO 80 CHARS
OUTREC FIELDS=(50,30) ===> WRITTES OUT ALL THE RECORDS FROM 50 TO 80 CHARS
//SYSUDUMP DD SYSOUT=*

Cheers,

Gops
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed Aug 17, 2005 5:51 pm    Post subject: Re: Interview Questions
Reply with quote

Quote:
3) How to retrieve duplicate rows from a particular table?

Code:
SELECT * FROM <TABLE NAME> GROUP BY <COLUMN NAME> , <COLUMN NAME> HAVING COUNT(*) > 1 ;


Regards,

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

New User


Joined: 23 Mar 2005
Posts: 25

PostPosted: Fri Aug 19, 2005 10:04 am    Post subject: Re: Interview Questions
Reply with quote

Thanks to everybody but what about my 1st and 2nd questions

Thanks inadvance
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Aug 21, 2005 7:14 am    Post subject:
Reply with quote

Hi Keerthi,

Thanooz has answered your 1st ques if the KSDS key contains the record's position# in the file or if you know the key value of the 80th rec. I'd PERFORM the READ (NEXT)/update/REWRITE 11 times.

If not ques1 & 2 have similar answers. See below:

OPEN the file I-O; READ the 1st 80 recs; after the 80th READ update the rec and REWRITE it; do the same for the next 10 recs; CLOSE the file.

To use this technique for ques1 define the ACCESS MODE as SEQUENTIAL or DYNAMIC. If you use DYNAMIC you must use READ NEXT.
Back to top
View user's profile Send private message
sendil

New User


Joined: 30 Jun 2005
Posts: 27

PostPosted: Thu Aug 25, 2005 6:29 pm    Post subject:
Reply with quote

2) by using skip and count command, you can directly position your cursor to 80th record. Then you can update it. Correct me if i am wrong
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Aug 27, 2005 10:25 pm    Post subject:
Reply with quote

Hi Sendil,

What are skip and count commands? Where are they documented?

Thanx, Jack.
Back to top
View user's profile Send private message
sushant

New User


Joined: 29 Aug 2005
Posts: 1

PostPosted: Mon Aug 29, 2005 12:34 am    Post subject: separate conversion
Reply with quote

i have stored a1b2c3 in avariable how can i move abc to 1 var and 123 to another separately
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 The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts SAS Programming - Basic Questions Techelm All Other Mainframe Topics 3 Fri Mar 18, 2016 10:53 pm


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