Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Records must be in reverse order

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
venkatarao

New User


Joined: 19 Dec 2004
Posts: 24
Location: hyderabad

PostPosted: Mon Jul 04, 2005 10:15 am    Post subject: Records must be in reverse order
Reply with quote

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
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Jul 04, 2005 11:00 am    Post subject: Re: cobol
Reply with quote

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
View user's profile Send private message
ideas

New User


Joined: 25 May 2005
Posts: 53
Location: India

PostPosted: Mon Jul 04, 2005 4:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us