View previous topic :: View next topic
|
Author |
Message |
Brian's_song
New User
Joined: 27 Dec 2005 Posts: 21
|
|
|
|
Hi all,
Just a question"
Input data:
=================================
AAA@001
AAA~001
AAA#002
BBB%001
BBB&001
CCC*001
CCC(001
CCC)001
=================================
for a certain name-colunm 1 to 3 (AAA,BBB,CCC), once there is one of his score (column 5-column 7) not = 001, his name will be written to the out put file.
So the expected out put is:
=================================
AAA
=================================
How can I do it ? Thanks! |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Hi Brian,
You can do this lot of ways.
If you are able to understand the FOCUS Language. I can do it and give for you. Let me know if you are intrested in FOCUS.
Thanks
Shri |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what I think you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
* Get records with not = 001 in 5-7
INCLUDE COND=(5,3,CH,NE,C'001')
* Sort on name
SORT FIELDS=(1,3,CH,A)
* Remove duplicates for each name
SUM FIELDS=NONE
* Show name
OUTREC FIELDS=(1,3)
/*
|
|
|
Back to top |
|
|
Brian's_song
New User
Joined: 27 Dec 2005 Posts: 21
|
|
|
|
Hi shrivatsa,
Thanks you for your advice. But I am not understand.
Hi Frank,
The data I gave was just a part of the whole. Actually, For each certain Name, there will be 1 to 99 score for him, for instance, may be AAA have 3 scores, so he will have 3 records; for BBB, he be has 10 scores so there will be 10 records which column 3 to 10 is 'BBB', etc
What I sould do is :For a cartain Name, if not all of his score is = 001,
I will catch this Name and write it into the output file. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I gave you a job based on what you asked for. If you wanted something else, why didn't you say so in the first place? First you say the name is in 1-3 - now you seem to be saying the name is in 3-10. Which is it?
I think the job I gave you does what you want, although if the fields are not where you said they were in your first post, you'll need to change the control statements accordingly. Did you try that?
If you still need help, then please show a better example of the records in your input file and what you want for output, and explain clearly the "rules" for getting from input to output. What is the position, length and format of the name field? What is the position, length and format of the score field? What is the RECFM and LRECL of the input file? |
|
Back to top |
|
|
|