IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Checking for changed and non changed values


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
appu.venkat

New User


Joined: 29 Jan 2007
Posts: 22
Location: India

PostPosted: Mon Feb 26, 2007 11:11 am
Reply with quote

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
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Mon Feb 26, 2007 1:31 pm
Reply with quote

Hi,
Could you plesse put some Example of the i/p and o/p of your requirement?

Thanks
Krishy
Back to top
View user's profile Send private message
appu.venkat

New User


Joined: 29 Jan 2007
Posts: 22
Location: India

PostPosted: Mon Feb 26, 2007 1:52 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Feb 26, 2007 9:28 pm
Reply with quote

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
View user's profile Send private message
appu.venkat

New User


Joined: 29 Jan 2007
Posts: 22
Location: India

PostPosted: Tue Feb 27, 2007 10:13 am
Reply with quote

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
View user's profile Send private message
appu.venkat

New User


Joined: 29 Jan 2007
Posts: 22
Location: India

PostPosted: Tue Feb 27, 2007 12:13 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 27, 2007 10:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
Search our Forums:

Back to Top