Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Query for OUTREC with sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
Vagdevi sesha

New User


Joined: 30 Jun 2009
Posts: 1
Location: chennai

PostPosted: Tue Jun 30, 2009 6:42 pm    Post subject: Query for OUTREC with sort
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
References
Anuj Dhawan

Global Moderator


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

PostPosted: Tue Jun 30, 2009 7:20 pm    Post subject:
Reply with quote

http://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: 181
Location: Bangalore

PostPosted: Tue Jun 30, 2009 7:27 pm    Post subject:
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: 6469
Location: Brussels once more ...

PostPosted: Tue Jun 30, 2009 7:29 pm    Post subject:
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: 3
Location: United States

PostPosted: Wed Jul 01, 2009 2:32 am    Post subject: Reply to: Query for OUTREC with sort
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1