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

How do we delete records in sequntial DS?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sivasu_usavis

New User


Joined: 28 Jun 2006
Posts: 21
Location: Chennai

PostPosted: Wed Jun 28, 2006 12:17 pm
Reply with quote

Is there any other way expect, Replacing the records other than record which going to delete then rename the same?
Back to top
View user's profile Send private message
sivasu_usavis

New User


Joined: 28 Jun 2006
Posts: 21
Location: Chennai

PostPosted: Thu Jun 29, 2006 10:14 am
Reply with quote

sivasu_usavis wrote:
Is there any other way except, Replacing the records other than record which going to delete then rename the same?
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Thu Jun 29, 2006 10:19 am
Reply with quote

Hi,

Quote:
Is there any other way expect, Replacing the records other than record which going to delete then rename the same?


Please elaborate your problem.

Regards
Rupesh
Back to top
View user's profile Send private message
vijayanand_cse

New User


Joined: 12 Jun 2006
Posts: 13
Location: Chennai

PostPosted: Thu Jul 27, 2006 1:11 pm
Reply with quote

You can acheive it from your run jcl as follows:

//STEP0001 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=YOUR.DATASET
//SORTOUT DD DISP=SHR,DSN=YOUR.DATASET
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=XXX
/*


In COND field, you given whatever key field that you dont want.

Regards
Vijay
Back to top
View user's profile Send private message
sivasu_usavis

New User


Joined: 28 Jun 2006
Posts: 21
Location: Chennai

PostPosted: Thu Jul 27, 2006 3:24 pm
Reply with quote

vijayanand_cse wrote:
You can acheive it from your run jcl as follows:

//STEP0001 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=YOUR.DATASET
//SORTOUT DD DISP=SHR,DSN=YOUR.DATASET
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=TTT
/*


In COND field, you given whatever key field that you dont want.

Regards
Vijay



thanks mr., but i have one little doubt, in that COND field how do we specify key field,since it is sequrntial data set.
Back to top
View user's profile Send private message
vijayanand_cse

New User


Joined: 12 Jun 2006
Posts: 13
Location: Chennai

PostPosted: Sun Jul 30, 2006 3:22 pm
Reply with quote

Hi,

I will explain with an example. Your dataset may be sequential file but your data will have any (assumed) key field. That one is user defined.

Assume your following data:
-Name(10)- --DOB(6)-- --City(10)--
Sivasu 072282 Chennai
Vijay 092883 Chennai
Anand 092883 Chennai


If you dont want the record having name="Sivasu", the code will be like this:

//STEP0001 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=YOUR.DATASET
//SORTOUT DD DISP=SHR,DSN=YOUR.DATASET
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=(1,10,CH,EQ,'Sivasu')
/*


That is, it will delete all the records which contains the name 'Sivasu' in first 10 bytes.

Regards
Vijay
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sun Jul 30, 2006 5:14 pm
Reply with quote

Here is a REXX I wrote:
Code:

/*------------------------------- REXX ------------------------------- 
 * PROGRAM   : EMPTYDSN                                                 
 * FUNCTION  : EMPTY DATASET                                           
 * AUTHOR    : OFER                                                     
 * DATE      : 03/06/03                                                 
 * HOW TO USE: X = EMPTYDSN(DSNAME) or as a 3.4 command                                   
 *           :                                                         
 *------------------------------------------------------------------*/ 
                                                                       
ARG DSN                                                                 
IF DSN = ' ' THEN DO                                                   
  EXITRC = 99                                                           
  SIGNAL ENDEXEC                                                       
END                                                                     
                                                                       
DSN = STRIP(DSN,"B","'")                                               
                                                                       
D = OUTTRAP('DUMMY.')                                                   
  ADDRESS TSO "REPRO INDA('"DSN"') OUTDA('"DSN"') COUNT(0)"             
D = OUTTRAP('OFF')                                                     
                                                                       
EXITRC = RC                                                             
                                                                       
ENDEXEC:                                                               
EXIT EXITRC                                                             
                                                                       


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

New User


Joined: 28 Jun 2006
Posts: 21
Location: Chennai

PostPosted: Mon Jul 31, 2006 10:27 am
Reply with quote

thanks vijay, for ur kind of explaination to my doubt... i'm fully clear with urs. i hope it ll make me more easier
Back to top
View user's profile Send private message
sivasu_usavis

New User


Joined: 28 Jun 2006
Posts: 21
Location: Chennai

PostPosted: Mon Jul 31, 2006 10:33 am
Reply with quote

could u make me more clear in "comp" clauses???
Back to top
View user's profile Send private message
vijayanand_cse

New User


Joined: 12 Jun 2006
Posts: 13
Location: Chennai

PostPosted: Mon Jul 31, 2006 10:55 am
Reply with quote

Hi,

When you declare a data-item as comp, it leaves the choice of the data type to the compiler writer. The intent of this data type is to make it the most efficient format on any given machine, which is usually some binary format.

Regards
Vijay
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top