How to display a word / name in reverse format in COBOL prog
Moderators: dbzTHEdinosauer, Moderator Group
How to display a word / name in reverse format in COBOL prog
How to display a word / name in reverse format in COBOL prog without using any instrinc functions.
example: RAMESH to display as 'HSEMAR'
example: RAMESH to display as 'HSEMAR'
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Define the 6 bytes of the "input" individually as pic x.
Define the 6 bytes of the "output" individually as pic x.
Move the fields one at a rime to the desired output positions.
Yes, not a solution that would be uesed in the "real world" but meets the requirement as posted.
If TS does a better job of explaining, we may be able to offer "better" solutions.
Define the 6 bytes of the "output" individually as pic x.
Move the fields one at a rime to the desired output positions.
Yes, not a solution that would be uesed in the "real world" but meets the requirement as posted.
If TS does a better job of explaining, we may be able to offer "better" solutions.
Last edited by DikDude on Fri Jul 20, 2012 12:01 am, edited 1 time in total.
Have a good one
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
that makes no sense whatsoever.No special functions. I want in general in reverse format.
why not use intrinsic functions,
which will perform better than a coded index up and down routine?
by the way, instrinsic functions are a general way to do something.
i should have mentioned something earlier,
i can only assume this is a homework assignment for a class.
(if this is an actual work assignment that eventually go into production
you are wrong. the intrinsic function is the professional way to go)
in the future, it would be better to acknowledge up front,
that this is homework, so that we can better address your requirements.
This is after all a professional forum,
and suggestions are based on experience in the real world.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
Is this some direction you have been given or is this just something you want to learn . . ?No special functions. I want in general in reverse format.
The "general" way to reverse a set of characters is to use the intrinsic funtion. There is no good reason to have arrays and loops and/or reference modification in the code to do this. Understanding "how" reverse works would be valid, but not wasting time on the more difficult to maintain code that will also use more system resources.
Have a good one
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page