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

Interview Questions


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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
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
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: 1448
Location: Chicago, IL

PostPosted: Wed Aug 17, 2005 5:51 pm
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Comp interview questions Mainframe Interview Questions 5
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
No new posts The Last Two Question For You To Ask ... Mainframe Interview Questions 0
No new posts Mainframe Interview Questions CICS,CO... Mainframe Interview Questions 6
No new posts Viewing executing process in NDM .. q... IBM Tools 0
Search our Forums:

Back to Top