View previous topic :: View next topic
|
Author |
Message |
appu.venkat
New User
Joined: 29 Jan 2007 Posts: 22 Location: India
|
|
|
|
Hi All,
I would like to know how to check if the fields 1-5 of all the records in the input file are the same using DFSORT.The fields have no particular value,the check shud be generic.I jus want to check if the values remain the same.If yes,write those records to the output file. |
|
Back to top |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
Hi,
Could you plesse put some Example of the i/p and o/p of your requirement?
Thanks
Krishy |
|
Back to top |
|
|
appu.venkat
New User
Joined: 29 Jan 2007 Posts: 22 Location: India
|
|
|
|
i/p
11111111
11111222
11111222
22222111
33333123
In this input file i wanna check if the first 5 chracters of all the records are same.The check has to be done in a general manner.I dont have any particular values as such.Is this information enof?? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Is this information enof?? |
No, it isn't. What do expect for the output records? It really isn't clear what you want to do based on your "check". Are the records already in sorted order as shown? Do you want to just write the duplicate records to the output file or do you want to do something else? And what is the RECFM and LRECL of the input file? |
|
Back to top |
|
|
appu.venkat
New User
Joined: 29 Jan 2007 Posts: 22 Location: India
|
|
|
|
I have an input file.It contains 'x' number of records.I want to sort it based on certain conditions which iam able to do.after that this is wat i have to do whcih iam not able to implement.The fields 1-5 of all the records contain the policy number.All i wanna know is how to check if all records contain the same policy number.i donot know wat the policy number is but i jus wanna know if i can check if they are all the same.For eg.the easytrieve eauivalent of this program does this:
IF POLICY NUMBER NOT CHANGED
CALL ABORT.
I wanna know how this can be done thru dfsort/icetool.
These are the properties of the file
Record format . . . : FB
Record length . . . : 39
Block size . . . . : 27963 |
|
Back to top |
|
|
appu.venkat
New User
Joined: 29 Jan 2007 Posts: 22 Location: India
|
|
|
|
In other words,I would like to check if the fields 1-5 of all the records in the input datatset match.How can i do this?? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for. It will set RC=12 if there's only one policy number, otherwise RC=0.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
* Get first record with each key.
SELECT FROM(IN) TO(T1) ON(1,5,CH) FIRST
* If one policy number, set RC=12.
* If > one policy number, set RC=0.
COUNT FROM(T1) EQUAL(1)
/*
|
|
|
Back to top |
|
|
|