View previous topic :: View next topic
|
Author |
Message |
angel246
New User
Joined: 05 Jul 2024 Posts: 4 Location: india
|
|
|
|
Hi ,
I need the sort card to find out the characters which are repeated in a particular field. the i/p file is as mentioned below
Denise Terry 101 Healthcare
Harrison Robbert 102 ECE
Harrison Jaccob 103 Manufacturing
I/P file Layout as follow: 1-25[ Person Name] 26-3 [emp#] 30-10[Dept]
Need to extract the chars which are repeated in Person Name field i.e 1-25 position and display those characters in output file
The output should be:
R ------> for 1st rec
R,B ------> for 2nd Rec
R,C ------> for 3rd rec
thanks in advance |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Your attempts to achieve that are? |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Basically you can get results as
Code: |
Denise Terry r
Harrison Robbert r b
Harrison Jaccob r c
Sauerstoffflasche ff |
The problem is with the last entry where you have three repeating chars. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
SORT is not convenient for a task of this kind. It resembles using a screwdriver for hammering nails: this is also possible, but highly inconvenient.
Are you familiar with any other mainframe tool? There are plenty of much more suitable ones. |
|
Back to top |
|
|
angel246
New User
Joined: 05 Jul 2024 Posts: 4 Location: india
|
|
|
|
yeah i can understand sort is not convenient way but It was asked in one of interviews i said it can be achieved in cobol using Inspect but he asked me to do in SORT . So i am curious to know. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
Something like this is possible, though senseless...
Code: |
Denise Terry r
Harrison Robbert r,b
Harrison Jaccob r,c
Sauerstoffflasche ff
Aabbccddeeffgghhh b,c,d,e,f,g,hh
Drossellklappann s,l,p,n |
Serious drawback: 'A' != 'a' |
|
Back to top |
|
|
angel246
New User
Joined: 05 Jul 2024 Posts: 4 Location: india
|
|
|
|
sort card plz to achieve this? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
angel246 wrote: |
sort card plz to achieve this? |
First of all, please show us any of your own efforts.
The style of this forum is supposed to be as follows:
Quote: |
I need to do the task like <this>
I tried to achieve it using <this> method, and used <this> code to perform it.
I expected to get the results like <this> and <this>, but instead I received <this> result, and <this> messages.
Please advise, what did I wrong, or how to find the reason of misbehavior?
Thank you |
Instead of said above your style of discussion is as follows:
Quote: |
I have a requirement to do <this> and <this>.
I'm new to mainframe (or to Computer Science), so I have not a minor idea: how it can be done?
Please, do my full job for me, if you can.
Thank you |
|
|
Back to top |
|
|
angel246
New User
Joined: 05 Jul 2024 Posts: 4 Location: india
|
|
|
|
Currently i dont have mainframe id as i lost my job i started attending interviews ..this is one of interview questions which i faced in one of interviews..I tried to figure out by thinking of all the options in sort based on my knowledge..but i couldnt get it..if i get any online sort compiler i can try like cobol online compiler for cobol program.
I checked in google to get the sort card which can do the count of the repeated occurrence of characters in a field i couldnt get it |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
Access to mainframe would not help unless one has got any minor idea in his mind. Access to documentation is required.
In the interview usually nobody is given access to a computer, too. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Cleaned up the post ..
if it was asked in an interview then am moving to another meter view section of this forum and also please use code tags while representing any data or code.
Thanks |
|
Back to top |
|
|
|