View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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. . .
Post the sample input and output wanted from that input along with the other requested info. |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Good idea, Kolusu.
Thanks. |
|
Back to top |
|
|
|