View previous topic :: View next topic
|
Author |
Message |
Bhargav_1058
New User
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
Hi,
Can you please help me to achieve the below?
I have a VSAM file of Variable length (LRECL=1240).
I want to overlay the 585 position with 'N' and 586 position with '00' if the 1st position is equal to 1.
I have tried the below sort but it gave me syntax error in OUTREC.
Code: |
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(5,1,CH,EQ,C'1'),OVERLAY=(589:N,590:00)) |
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Should n't it be
Code: |
OVERLAY=(589:C'N00')) |
|
|
Back to top |
|
|
Bhargav_1058
New User
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
I tried this but got the VSAM logical error (SORTIN and SORTOUT are the same VSAM file).
Code: |
ALTERNATE PARM USED
SYSDIAG= 591180, 1525196, 1525196, 1075617
1,028K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
0 BYTES RESERVE REQUESTED, 1,572,280 BYTES USED
32K BYTES OF EMERGENCY SPACE ALLOCATED
SORTIN : RECFM=V ; LRECL= 1240; CISIZE = 4096
OUTREC RECORD LENGTH = 1244
SORTOUT : RECFM=V ; LRECL= 1240; CISIZE = 4096
7,836K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
0 BYTES RESERVE REQUESTED, 559,544 BYTES USED
[b]VSAM LOGICAL ERROR 08 ON OUTPUT [/b]
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
SYNCSORT topics should be posted in the JCL forum |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Using the same file as input and output is not advisable. Why dont you write the formatted output to a PS and REPRO it back to your original VSAM file. |
|
Back to top |
|
|
Bhargav_1058
New User
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
Thats absolute!!
When I used a PS file and the same above sort it worked... Thanks a lot for your suggession... |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Good to hear its working. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Since the input is a VSAM file, we use RECORD TYPE=F to tell SORT to process it as fixed-length records, is not it? I've not verified with VSAM files at my end, however, with these messages:
Code: |
SORTIN : RECFM=V ; LRECL= 1240; CISIZE = 4096
OUTREC RECORD LENGTH = 1244
SORTOUT : RECFM=V ; LRECL= 1240; CISIZE = 4096 |
it looks like you need to consider about RDW. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Bhargav_1058 wrote: |
(SORTIN and SORTOUT are the same VSAM file).
|
For a COPY operation, SORT opens the SORTIN and SORTOUT data sets in parallel. So it reads a record from the data set and then writes that record to the same data set. This can result in messing up the data set. It may work sometimes, but it is NOT guaranteed to work. It's risky and should be avoided. On the other hand, for a SORT operation, SORT opens the SORTIN data set, reads all of the records and then closes the SORTIN data set. Then it opens the SORTOUT data set, writes to it and closes it - no parallel processing to mess things up. though, you can still lose the data set if something goes wrong (e.g. an I/O error) so you should have a backup or avoid doing this -- so make your choice! |
|
Back to top |
|
|
Bhargav_1058
New User
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
Anuj,
Thanks for you advice! I have taken a copy of the VSAM file to a VB file. I have used this file for OUTREC OVERLAY instead of the VSAM file in SORTIN and SORTOUT and apart from this I do take a BACKUP.
So, now I will be safe side if there is an I/O error.
Thanks again detailed explanation on how sort works. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I hope I had been helpful.
Good Luck |
|
Back to top |
|
|
|