View previous topic :: View next topic
|
Author |
Message |
callkris_cit
New User
Joined: 22 Apr 2006 Posts: 44
|
|
|
|
I have the VB file record length = 20, i want to insert 1 at the end of every record. So my expected output file VB length is 21. I gave the below Sort card.
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(5:5,16,21:C'1')
|
But it's giving the below error.
wer235a OUTREC RDW NOT INCLUDED
Regards
Suresh |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
callkris_cit wrote: |
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(5:5,16,21:C'1')
|
But it's giving the below error.
wer235a OUTREC RDW NOT INCLUDED |
Try
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1,20,C'1')
|
|
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
callkris_cit, You can use this too,
Code: |
SORT FIELDS=COPY
OUTREC OVERLAY=(21:C'1') |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Above task can be done as:
Code: |
SORT FIELDS=COPY
INREC OVERLAY=(21:C'1') |
which one will work faster, INREC or OUTREC. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
krisprems wrote: |
Its not that INREC or OUTREC works faster, its only that how efficiently and suitably its implemented. |
Can you please let me know, in the above case which one will work faster. Document gives very general view of INREC & OUTREC, I could not corelate them with the code in question very well, do you have some explanatory suggestion? |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Anuj
This point
Quote: |
In general, OUTREC should be used rather than INREC so your SORT and SUM statements can refer to fields in the original input records. |
in the above pointed link, says that outrec to be used for efficiency, since it can refer to fields in the original input records.
But in our case its just SORT FIELDS=COPY, so no matter whether you use INREC or outrec. |
|
Back to top |
|
|
|