Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 & VSAM
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    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

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
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: 205
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: 8593
Location: Back in jolly old England

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: 2
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us