View previous topic :: View next topic
|
Author |
Message |
nileshyp
New User
Joined: 22 Jun 2005 Posts: 65 Location: Mumbai
|
|
|
|
Hi,
I am little confused about below requirement and need help on building code/psudocode. The requirement is as below
1: File 1 acct-range (account ranges file) contains are as below 9onle 2 records)
0011000 0059999
0081000 0099999
2: File 2 data file ( details files)
Logic required
Want to read file 1 and aslo want to read file 2
If the the accounts matches with account in data file then populates details from details file and create reports with cretain condition.
Please help me to build above logic with with sample code or some way.
Note both the files have key variable of same length.
Regards,
Nilesh |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
it' s sunday and I am in a good mood ...
let' s assume that each record of file1 contains a range
lets call
recd the key of the record to be processed ( file2 )
key1 and key2 the two keys present in each record of the control file (file1)
Code: |
read one record from file 2
read one record from file 1
build key1 and key2 for the first range
if at end of file fill key1 with an high value
do until endoffile(file2)
if recd >= key1 & recd <= key2
/* match - within range */
process the record for match
read one record from file2
iterate/continue the do
end if
if recd < key1
/* not match , below range */
process the record for not match
read one record from file2
iterate/continue the do
end if
if recd > key2
/* not match , above range */
read another record from file 1
build key1 and key2 for the next range
if at end of file fill key1 with an high value
iterate/continue the do
end if
end
do end of file processing and cleanup
|
|
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Vasanth,
Please help me as I do not speak smiley face very well.
What does the eye rolling face mean?
Is this a positive contribution to the thread? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
vasanthkumarhb wrote: |
|
maybe he cannot follow/understand a simple pseudocode,
it would be worth to meditate a career shift
he made another post with the rolling eyes and somebody ( not me ) deleted it |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Quote: |
he made another post with the rolling eyes and somebody ( not me ) deleted it |
I believe that might have been me. . .
IIRC - It added nothing to the topic and i couldn't understand why it was even posted. . .
d |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Maybe a written explaination is in order... Vansanth, anything to say? |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Thanks for your comments Enrico.
Quote: |
it would be worth to meditate a career shift
he made another post with the rolling eyes and somebody ( not me ) deleted it |
You would have made it still more simpler which i felt. What ever you want you are speaking here???? Crazy....!!
Quote: |
Is this a positive contribution to the thread? |
Yes |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
You would have made it still more simpler which i felt. What ever you want you are speaking here???? Crazy....!! |
ok for the language barrier, but could You please translate
and clarify Your comment?
was my pseudocode not clear, wrong, what ... ?
I see there are a few typos, hope You will forgive me!
anyway looks that we are all wasting time here
the TS just disappeared
Quote: |
IIRC - It added nothing to the topic and i couldn't understand why it was even posted. . .
|
to p*** off people willing to help
edited to add a further comment, not to change history
the TS in the original post asked
Quote: |
Please help me to build above logic with with sample code or some way. |
I replied with the logic, up to him the code... |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
I find this forum very very interesting, especially when I see you guys disputing...
hello, enrico, when did you change your image? I hardly cannot recognize you... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
well.... we are not disputing ( me at least )
we are just trying to get a non stupid reason for the post with the rolling eyes
and to understand why it is topic related |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Personally I can see absolutely no value in that post, nor in the attempt to validate it.
If you can not contribute constructively then why bother.
You have been warned |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi Enrico !
>> we are just trying to get a non stupid reason for the post with the rolling eyes
Do you really believe, you will get a truthful reason? I think it's just a waste of time. Would be nothing else than fucking nonsens.
For my own, i find it interesting, that this is a subject, that is discussed by a few high experienced IT-specialists. The so called creme de la creme of the 21st century.
And for me, working as an well payed consultant, it' its a diverting dissipation. And a chance to proclaim my utter bollocks to this discussion here and getting money for it.
Please don't get me wrong. Don't consider this as an affront. I have the deepest respect for persons who bother oneself about something.
But sometimes it's not worth to do this. :-)
Btw, your pseudo-code was well done, and that on a holy Sunday !!! |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Believing there is no evil in the human being, i guess a wrong emoticon was entered.
And yes, im not myself today. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Goedemorgen Peter !
Youw geloof aan de mensheid behouden geloven dag.
Veel groeten, UmeySan |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Hi UmeySan!
Quote: |
For my own, i find it interesting, that this is a subject, that is discussed by a few high experienced IT-specialists. The so called creme de la creme of the 21st century.
...
Please don't get me wrong. Don't consider this as an affront. I have the deepest respect for persons who bother oneself about something. |
No offence at all!
it is really very difficult even for experienced people
to choose the posts to reply and how to reply...
post like this one and like for example
ibmmainframes.com/viewtopic.php?t=53336&highlight=
should not have place in a professional forum but...
in this case I was pitying a pour soul and tried to help!
but nobody is ever happy around here
You are rude,
You replied/did not reply to a silly question,
You did not reply/replied to an intelligent question
I feel insulted,
my feet hurt,
my only neuron is tired,
my two only neurons went in a spin loop
You did not explain,
You did not give me the answer I expected
...
it' s urgent
I asked here because my support does not support me (*)
add as many idiotic complaints and whinings as You like
I just lurk and reply while doing something more interesting (*)
and I like ( since I can afford it ) to use sarcasm and unusual words
and even providing useful infos and replies
have a good day UmeySan
cheers
enrico
(*) for some people the best support would be certainly a rope around the neck |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Dank jewel UmeySan |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Enrico,
Your last comment about support |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
that' s what I would call dark/gothic sarcasm |
|
Back to top |
|
|
nileshyp
New User
Joined: 22 Jun 2005 Posts: 65 Location: Mumbai
|
|
|
|
Hi,
Can anyone of above help me to understand the logic little more clear as I am still confused?
I have 2 files
1st file just have account range (1000 9999 etc..)
2nd file with data
if anyof the account in the data file match with the account in the account range then perform some thing etc.
just need help on iteration perform part.
Please help. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
what did You not understand in the pseudo code I posted ? |
|
Back to top |
|
|
nileshyp
New User
Joined: 22 Jun 2005 Posts: 65 Location: Mumbai
|
|
|
|
Layout of both files are as follows
Code: |
Accnt range file :
01 ACCT-RANG-REC.
05 FROM-ACCT-NO.
10 ACRG-FROM-OFFC PIC X(03).
10 ACRG-FROM-ACCT PIC X(05).
05 THRU-ACCT-NO.
10 ACRG-THRU-OFFC PIC X(03).
10 ACRG-THRU-ACCT PIC X(05).
05 ACRG-FILLER PIC X(64).
Data file Key part
01 DATALINE-REC.
05 ML-KEY.
10 ML-CLIENT PIC XX.
10 ML-OFFC-ACCT.
15 ML-OFFICE PIC XXX.
15 ML-ACCOUNT PIC X(5).
10 ML-CURRENCY-CODE PIC XX. |
Till now i have done as follows
Code: |
Perform READ-ACCT-RANGES
READ ACNT-RANGE-FILE
END
MOVE HIGH-VALUES TO FROM-ACCT-NO
NOT END
ADD 1 TO AR-CTR
END-READ.
PERFORM I-MAIN-LOGIC THRU PARA-EXIT
UNTIL FROM-ACCT-NO = HIGH-VALUES.
MOVE FROM-ACCT-NO TO ML-OFFC-ACCT.
START MONY-LINE-FILE KEY >= ML-KEY.
EVALUATE ML-STATUS
WHEN '00'
PERFORM 175-READ-DATALINE-FILE
WHEN '23'
MOVE HIGH-VALUES TO ML-OFFC-ACCT
WHEN OTHER
DISPLAY 'ABORT NUMBER: ' ABEND-NUM
DISPLAY 'FILE STATUS : ' ML-STATUS
PERFORM 999-ABORT-JOB
END-EVALUATE.
175-READ-DATALINE-FILE.
READ DATA-LINE-FILE NEXT.
EVALUATE ML-STATUS
WHEN '00'
ADD 1 TO ML-CTR
WHEN '10'
MOVE HIGH-VALUES TO ML-OFFC-ACCT
WHEN OTHER
DISPLAY 'ABORT NUMBER: ' ABEND-NUM
DISPLAY 'FILE STATUS : ' ML-STATUS
PERFORM 999-ABORT-JOB
END-EVALUATE.
PERFORM UNTIL ML-OFFC-ACCT > THRU-ACCT-NO
perform...
peform ... etc
etc..
PERFORM 175-READ-DATALINE-FILE
Perform READ-ACCT-RANGES |
Could you suggest more efficient and simple way of achieving above?
Regards,
N |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
yeah, use the rope that enrico mentioned earlier. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Could you suggest more efficient and simple way of achieving above? |
It is not always possible to do this. Some problems just require a certain amount of logic (and hence code) to resolve -- and without completely changing the problem statement, you cannot get around this. Either learn to deal with the complexity, or get used to being utterly confused as an IT person, or find a career that doesn't require the complexity. Your choice. |
|
Back to top |
|
|
nileshyp
New User
Joined: 22 Jun 2005 Posts: 65 Location: Mumbai
|
|
|
|
Anyway.. can you please give me some examples of such programs so that i will take a look and try to buid it accordingly. |
|
Back to top |
|
|
|