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

OUTREC - Overlay error


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Tue Oct 26, 2010 11:05 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Oct 26, 2010 11:11 am
Reply with quote

Should n't it be
Code:
OVERLAY=(589:C'N00'))
Back to top
View user's profile Send private message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Tue Oct 26, 2010 11:35 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Oct 26, 2010 11:57 am
Reply with quote

SYNCSORT topics should be posted in the JCL forum
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Oct 26, 2010 12:31 pm
Reply with quote

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
View user's profile Send private message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Tue Oct 26, 2010 12:34 pm
Reply with quote

Thats absolute!!

When I used a PS file and the same above sort it worked... Thanks a lot for your suggession...
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Oct 26, 2010 12:37 pm
Reply with quote

Good to hear its working. icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Oct 26, 2010 3:29 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Oct 26, 2010 3:30 pm
Reply with quote

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
View user's profile Send private message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Tue Oct 26, 2010 6:37 pm
Reply with quote

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. icon_smile.gif

Thanks again detailed explanation on how sort works.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Oct 26, 2010 9:03 pm
Reply with quote

I hope I had been helpful.

Good Luck icon_smile.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top