View previous topic :: View next topic
|
Author |
Message |
venkatarao
New User
Joined: 19 Dec 2004 Posts: 23 Location: hyderabad
|
|
|
|
i have two files A, B
contents in A are
abc
xyz
pry like
contents in B are
def
ghi
jkl like
i want to copy these two files records into some another file like c but records must be in reverse order like
conteents in c must be
record abc like cba like how we do that? |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
If you are looking for a COBOL CODE.......
Code: |
OPEN INPUT INFILE
OUTPUT OUT FILE.
PROCESS UNTIL END-INFILE.
CLOSE INFILE, OUTFILE.
PROCESS.
READ INFILE INTO INREC AT END SET END-INFILE TO TRUE.
MOVE INREC(3:1) TO OUTREC(1:1).
MOVE INREC(2:1) TO OUTREC(2:1).
MOVE INREC(1:1) TO OUTREC(3:1).
WRITE OUTFILE FROM OUTREC.
EXIT. |
This is for the string of length of 3.
Regards,
Priyesh. |
|
Back to top |
|
|
ideas
New User
Joined: 25 May 2005 Posts: 52 Location: India
|
|
|
|
1-confirm from frank and team if theres a SORT util which can do this in reverse fashion..
2-via code where I dont need to use the LRECL..may be reading in an array..changing the Subscript by -1 then may be of help..
3-also check, is there a REVERSE func defined in COBOL?
btw where was it asked? |
|
Back to top |
|
|
|