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
 

 

How do we delete records in sequntial DS?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How do we delete records in sequntial DS?
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    Post subject: Re: How do we delete records in sequntial DS?
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: 464

PostPosted: Thu Jun 29, 2006 10:19 am    Post subject: Re: How do we delete records in sequntial DS?
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    Post subject: Re: How do we delete records in sequntial DS?
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    Post subject: Re: How do we delete records in sequntial DS?
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    Post subject: Re: How do we delete records in sequntial DS?
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: 2360
Location: Israel

PostPosted: Sun Jul 30, 2006 5:14 pm    Post subject:
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    Post subject: Re: How do we delete records in sequntial DS?
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    Post subject: Re: How do we delete records in sequntial DS?
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    Post subject: Re: How do we delete records in sequntial DS?
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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