View previous topic :: View next topic
|
Author |
Message |
keerthi
New User
Joined: 23 Mar 2005 Posts: 25
|
|
|
|
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 |
|
|
thanooz
New User
Joined: 28 Jun 2005 Posts: 99
|
|
|
|
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 |
|
|
Gops
New User
Joined: 21 Jul 2005 Posts: 23
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
keerthi
New User
Joined: 23 Mar 2005 Posts: 25
|
|
|
|
Thanks to everybody but what about my 1st and 2nd questions
Thanks inadvance |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
sendil
New User
Joined: 30 Jun 2005 Posts: 27
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Sendil,
What are skip and count commands? Where are they documented?
Thanx, Jack. |
|
Back to top |
|
|
sushant
New User
Joined: 29 Aug 2005 Posts: 1
|
|
|
|
i have stored a1b2c3 in avariable how can i move abc to 1 var and 123 to another separately |
|
Back to top |
|
|
|