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

Query for OUTREC with sort


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

New User


Joined: 30 Jun 2009
Posts: 1
Location: chennai

PostPosted: Tue Jun 30, 2009 6:42 pm
Reply with quote

How to copy a variable length file into an another file (it is also a variable length file) and also add 2 fields at the end of output file.
I have used Sort with OUTREC with different options. I got errors like SHORT RECORD, RDW not included etc
Code:
//SORT1    EXEC  PGM=SORT                                 
//*                                                       
//SORTIN   DD  DSN=MLIFE22.VCSE.TCONTF.DB2BKUP(0),         
//             DISP=SHR                                   
//SORTOUT  DD  DSN=TLIFE22.VCSE.TCONTF.DB2BKUP.NEW,       
//             DISP=(NEW,CATLG,DELETE),                   
//             DATACLAS=DATAV,LRECL=2323                   
//SYSIN    DD  *                                           
 SORT FIELDS=COPY                                         
 OUTREC FIELDS=(1:5,2314,2319:X'099999999C')               
/*

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
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 Jun 30, 2009 7:20 pm
Reply with quote

www.ibmmainframes.com/viewtopic.php?t=33728&highlight=rdw
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Tue Jun 30, 2009 7:27 pm
Reply with quote

Hi,

You need to include first four bytes (RDW) in the input VB file into the o/p file as well

Try changing
OUTREC FIELDS=(1:5,2314,2319:X'099999999C')

to

OUTREC FIELDS=(1:1,4,5:5,2314,2319:X'099999999C')


Thanks,
Ajay
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 30, 2009 7:29 pm
Reply with quote

Anuj, Methinks the problem is appending the PD field at the end of the record.
Code:

SORT FIELDS=COPY
OUTREC FIELDS=(1,4,5)

Will copy the RDW and the variable part of the record to output. I have searched without success and might even try a quick google on how to append the additional field onto the end of a variable length record.

I have had a play with this, again without success using DFSORT.

As this is posted in the JCL forum I assume that the product is SYNCSORT rather than DFSORT.
Back to top
View user's profile Send private message
Brian Wood

New User


Joined: 12 Feb 2009
Posts: 2
Location: United States

PostPosted: Wed Jul 01, 2009 2:32 am
Reply with quote

Vagdevi:
You might want to try something like this:

Code:
//TEST12   EXEC PGM=SORT
//SORTIN    DD DSN=your.input,                   
//             DISP=SHR                   
//SORTOUT   DD DSN=your.output...       
//SYSOUT    DD SYSOUT=*                               
//SYSIN     DD *                                     
  SORT FIELDS=COPY                                   
  OUTFIL FILES=OUT,                                   
         OUTREC=(1,4,5,2314,X'099999999C'),VLFILL=X'00'


Please let us know if you require further assistance with this.
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 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 RC query -Time column CA Products 3
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