| View previous topic :: View next topic |
| Author |
Message |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Fri Jul 07, 2006 11:27 pm Post subject: want to revert the seq of the record |
|
|
Hi,
I've saw a method to revert the sequence occasionally like:
old: 1234
new: 4321
What the option for this?I fogot the subject of the post. |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12401 Topics: 75 Location: San Jose
|
Posted: Sat Jul 08, 2006 6:57 am Post subject: |
|
|
issac1029,
Try this
| Code: |
//STEP0100 EXEC PGM=SORT
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1234
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(4,1, $ 4th byte
3,1, $ 3rd byte
2,1, $ 2nd byte
1,1) $ 1st byte
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Sat Jul 08, 2006 11:16 am Post subject: |
|
|
koluso,
NO,I want a whole row.maybe very long,to avoid a complcate code on sysin outrec,is there a option for revert? |
|
| Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Sat Jul 08, 2006 3:26 pm Post subject: |
|
|
There is no built-in option for reversing bytes.
How long a row length exactly? _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
| Back to top |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Sat Jul 08, 2006 4:36 pm Post subject: |
|
|
If the file is not too big and you can EDIT it, try the following Edit-Macro:
| Code: | /* REXX */
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "(LASTL) = LINENUM .ZLAST"
DO I = 1 TO LASTL
ADDRESS ISREDIT "(CURRL) = LINE &I"
NEWL = REVERSE(CURRL)
ADDRESS ISREDIT "LINE &I = (NEWL)"
END I
EXIT |
For bigger files, you can try the same method with EXECIO.
O.
________
[URL=http://www.ford-wiki.com/wiki/Ford_TH!NK]Ford TH!NK history[/URL]
Last edited by ofer71 on Sat Feb 05, 2011 11:37 am; edited 1 time in total |
|
| Back to top |
|
 |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Tue Jul 11, 2006 4:36 am Post subject: |
|
|
Hi Frank,
I just mean I don't want my code affected by the length~
The rexx seems a good choice.
ofer71:
What do you mean by 'file is not too big'? |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12401 Topics: 75 Location: San Jose
|
Posted: Tue Jul 11, 2006 4:43 am Post subject: |
|
|
issac1029,
COBOL has an Intrinsic function REVERSE which does what you are asking for.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Tue Jul 11, 2006 6:09 am Post subject: |
|
|
issac1029 -
It depends in you REGION settings.
O.
________
no2 vaporizer review |
|
| Back to top |
|
 |
|
|
|