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

Updating a PDS member using SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Thu Feb 24, 2011 8:56 am
Reply with quote

I'm trying to update a PDS member. In that member I have to add a line after the eighth record. Rest of the records should remain as is.

There are total 11 lines in that member. I have to add a line "Total count=". The count is calculated using sort.

One way is to split that member in 2 parts by copying into 2 temporary dataset using STOPAFT=8 and SKIPREC=9 and merging them in the same member. Is there any other way I can do this?

Thanks.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Feb 24, 2011 9:52 am
Reply with quote

Just don't forget that you're dealing with a PDS member, so you have to copy the original content out, make the update, then copy that updated content back in. So your current process logic seems sound. Otherwise, you have to look at using a (TSO or ISPF) EDIT process which supports the concept of an update (insert) to a PDS member.

Putting an exclusive lock on a PDS by using DISP=OLD is a very poor practice that could get you in trouble. Stick with DISP=SHR.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Feb 24, 2011 11:50 pm
Reply with quote

rgupta71,

It's not clear what you're trying to do. Please show an example of the records in your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Feb 25, 2011 9:28 am
Reply with quote

Hi Frank,

I have the data that I want to insert after 8th record of a PDS member.

The PDS member contains email related information "To","from" ,"subject"
message.I am just trying to add a line after the existing message.

RECFM=FB,LRECL=80

Is this possible using sort?

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Feb 25, 2011 10:02 am
Reply with quote

Hello,

Quote:
Please show an example of the records in your input file (relevant fields only) and what you expect for output. . . .
Which part of Frank's request was not clear. . . icon_sad.gif

Post the sample input and output wanted from that input along with the other requested info.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Feb 25, 2011 11:59 pm
Reply with quote

THe content of the control card are
Code:

HELO XYZ                                                     
MAIL FROM:<xyz@abc.com>                               
RCPT TO:<xyz@abc.com>                       
DATA                                                             
TO:      xyz@abc.com                         
SUBJECT:Job complete xxxxxxxx                           
                                                                 
<current message,1 line>                                                                 
<I want to add my count here which is calculated from sort.>
                                                                 
-  THANK YOU                                                     
.                                                                 
QUIT                                                             


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

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Feb 26, 2011 12:09 am
Reply with quote

rgupta71,

Why bother updating a pds member , why can't you just create the email content in SORT job itself?

Much easier and very easy to maintain.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Sat Feb 26, 2011 1:16 am
Reply with quote

Good idea, Kolusu.

Thanks.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top