Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
When an employee with two difference write first record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 15
Location: chennai

PostPosted: Wed May 07, 2008 6:24 pm    Post subject: When an employee with two difference write first record
Reply with quote

Hi all,
consider a below input record (REF = 80 FB) contains employee and indicator
Input

Code:

Employee  Indicator
1                y
1                N
2                Y
3                Y
3                N


Output

Code:

Employee  Indicator
1                y
3                y


Req : same Employee with different indicator.When an employee with two different we need to write first record into output.
In our case employee 1 and 3 contains record with two different indicator so we need to write first occurance of record into output. Employee 2 doesn contains two type of indicator.so no need to write into output.

please help me out to sort this
Back to top
View user's profile Send private message
References
PostPosted: Wed May 07, 2008 6:24 pm    Post subject: Re: When an employee with two difference write first record Reply with quote

HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 87
Location: India

PostPosted: Wed May 07, 2008 6:57 pm    Post subject: Reply to: Solve this
Reply with quote

first gather only the values who are repeating in to file.
then duplicate using first column. guess it works.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 903
Location: germany

PostPosted: Wed May 07, 2008 7:18 pm    Post subject:
Reply with quote

could there be 3 records for an employee?

is the input file sorted? if so, what are the keys?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 903
Location: germany

PostPosted: Wed May 07, 2008 8:08 pm    Post subject:
Reply with quote

also, I would like to commend you for such a useful title/subject. I am sure that others searching will find a wealth of info.
Back to top
View user's profile Send private message
Skolusu

DFSORT Developer


Joined: 07 Dec 2007
Posts: 109
Location: San Jose

PostPosted: Wed May 07, 2008 10:26 pm    Post subject:
Reply with quote

The following DFSORT JCL will give you the desired results. I assumed that your employee is 10 bytes length key and the indicator starts at pos 15. I also assumed that the indicator must be Y or N.

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
1             Y                                           
1             N                                           
2             Y                                           
3             Y                                           
3             N                                           
4             N 
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                           
  OPTION EQUALS                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'00')),             
        IFTHEN=(WHEN=(15,1,CH,EQ,C'Y'),OVERLAY=(81:C'1')),
        IFTHEN=(WHEN=(15,1,CH,EQ,C'N'),OVERLAY=(82:C'1')) 
                                                           
  SORT FIELDS=(01,10,CH,A)                                 
  SUM FIELDS=(81,1,ZD,82,1,ZD)
  OUTFIL OMIT=((81,1,ZD,EQ,0,AND,82,1,ZD,GT,0),OR,
          (81,1,ZD,GT,0,AND,82,1,ZD,EQ,0)), 
      BUILD=(01,80)   
/*


Hope this helps...

Cheers

Kolusu
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1