Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

1. Remove duplicates, 2. File formatting based values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
suyash_agrawal

New User


Joined: 27 Nov 2006
Posts: 7
Location: India

PostPosted: Thu Nov 30, 2006 11:37 am    Post subject: 1. Remove duplicates, 2. File formatting based values
Reply with quote

Hello everyone,

I need your help to achieve the following:

1. Remove duplicates from file based on fragmented key

Input: FB, LRECL-80
Key fields: 4,3,CH & 10,2,CH (Composite)

AAAA111BB22
AAAA222BB34
BBBB111CC22
ABCD222BB33

Output:

AAAA111BB22
AAAA222BB34
ABCD222BB33

Requirement demands that output file should not be sorted.


2. Format file based on field values

Input: FB, LRECL 80

AAAAAAA (6 spaces in front)
BBBBBBBBB (3 spaces in front)
AAAAABB
BBBBDDDDD

Records starting at position 7 will always start with 'A' and those starting at position 4 will always start with 'B'.

Output: (2 spaces in front)

AAAAAAA
BBBBBBBBB
AAAAABB
BBBBDDDDD


Again if this can be done without sorting it'd be great.

Many Thanks,
Suyash
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Nov 30, 2006 11:41 am    Post subject:
Reply with quote

Hi Suyash,

For ur first query
Quote:
1. Remove duplicates from file based on fragmented key

In first step

Code:
//SYSIN    DD  *                   
   INREC FIELDS=(1,80,SEQNUM,8,ZD) 
   SORT FIELDS=(4,3,CH,A,10,2,CH,A)           
   SUM FIELDS=NONE                 
/*

In second step
Code:
//SYSIN    DD  *           
   SORT FIELDS=(81,8,ZD,A) 
   OUTREC FIELDS=(1:1,80)   
/*   


Hope it will helpful
Back to top
View user's profile Send private message
suyash_agrawal

New User


Joined: 27 Nov 2006
Posts: 7
Location: India

PostPosted: Thu Nov 30, 2006 12:13 pm    Post subject: Re: 1. Remove duplicates, 2. File formatting based values
Reply with quote

Thanks Ekta.

1. The problem i'm facing is that output file should not be sorted and should be in the same order as input with duplicates omitted.

2. The query hasn't come out as intended. Apologies for that. I'll try again:
Format file based on field values

Input: FB, LRECL 80 ('*' - space)

******AAAAAAA
***BBBBBBBBB
******AAAAABB
***BBBBDDDDD

Records starting at position 7 will always start with 'A' and those starting at position 4 will always start with 'B'.

Output:

**AAAAAAA
**BBBBBBBBB
**AAAAABB
**BBBBDDDDD

Again if this can be done without sorting it'd be great.

Cheers!
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Nov 30, 2006 12:31 pm    Post subject:
Reply with quote

Hi Suyash,

It should work as i specified in my prev post to resolve ur first issue we have to use two step in sort first step will remove the duplicate & sort them on concatenated key but we put a counter at 81 byte & in the second step it will put it in the original order according to that counter.
Back to top
View user's profile Send private message
suyash_agrawal

New User


Joined: 27 Nov 2006
Posts: 7
Location: India

PostPosted: Thu Nov 30, 2006 12:51 pm    Post subject: Re: 1. Remove duplicates, 2. File formatting based values
Reply with quote

Thanks a lot Ekta.
First issue is sorted now. I misunderstood your previous response.

Regards,
Suyash
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Thu Nov 30, 2006 1:41 pm    Post subject: Re: 1. Remove duplicates, 2. File formatting based values
Reply with quote

Hi,

For your second requirement you can use new JFY function in DFSORT.
Code:

OPTION COPY
INREC BUILD=(1,RECORDLENGTH,JFY=(SHIFT=LEFT,LEAD=C'**'))

Just have a look here
http://www-03.ibm.com/servers/storage/support/software/sort/mvs/peug/pdf/sortpeug.pdf

Hope it helps
Back to top
View user's profile Send private message
suyash_agrawal

New User


Joined: 27 Nov 2006
Posts: 7
Location: India

PostPosted: Thu Nov 30, 2006 2:31 pm    Post subject: Re: 1. Remove duplicates, 2. File formatting based values
Reply with quote

Thanks Subhasis.

I tried it but received following error:

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5
OPTION COPY
INREC BUILD=(1,2000,JFY=(SHIFT=LEFT,LEAD=C' '))
?
ICE006A 0 OPERAND DEFINER ERROR


Does it mean that the latest patch might not have been updated in my system?
I've used following JCL:

//CPSD0025 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input file
//SORTOUT DD DSN=output file
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,2000,JFY=(SHIFT=LEFT,LEAD=C' '))
/*
//*

Regards,
Suyash
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu Nov 30, 2006 9:07 pm    Post subject:
Reply with quote

suyash,

subhasis has the right idea but the actual DFSORT job would be as follows:

Code:

//S1    EXEC  PGM=ICEMAN                     
//SYSOUT    DD  SYSOUT=*                     
//SORTIN DD *                               
      AAAAAAA                               
   BBBBBBBBB                                 
      AAAAABB                               
   BBBBDDDDD           
/*                     
//SORTOUT DD SYSOUT=*                       
//SYSIN    DD    *                           
  OPTION COPY                               
  INREC BUILD=(2X,3,78,JFY=(SHIFT=LEFT))     
/*


The error message indicates you don't have z/OS DFSORT V1R5 PTF UK90007 (April, 2006) installed. You need that PTF to use JFY. Ask your System Programmer to install that PTF (it's free).
Back to top
View user's profile Send private message
suyash_agrawal

New User


Joined: 27 Nov 2006
Posts: 7
Location: India

PostPosted: Fri Dec 01, 2006 1:19 pm    Post subject: Re: 1. Remove duplicates, 2. File formatting based values
Reply with quote

Thank you Frank. I'll try to get it installed.

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

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us