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

Grouping of records


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

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 12:16 pm
Reply with quote

I want to group a records (inpt file pos 34 bytes 4)
like all 5064 will come first then 5099,5087,2356 and then all others will come
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Mon Jan 20, 2014 12:34 pm
Reply with quote

Hi,

Please search how to code with IFTHEN=(WHEN=GROUP...and post what you've tried here to help you further along with sample input/output.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 12:38 pm
Reply with quote

actually dont want to use build.
And want to keep the in put file as it is after arranging in above sequence
I am not getting when=group syntax without Build
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Mon Jan 20, 2014 12:42 pm
Reply with quote

Please read the manual for WHEN=GROUP and try to understand the logic of BUILD/OVERLAY used with. Try to code by yourself.
When you don't get your expected result, provide the code here... we will help you out.

BTW, When you post any question, please remember to give any code & example data to work with.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 1:28 pm
Reply with quote

Thanks for replying
I am trying with below

Code:
//SYSIN    DD *                                             
 SORT FIELDS=COPY                                           
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(34,4,CH,EQ,C'5375'),       
       IFTHEN=(WHEN=GROUP,(34,4,CH,EQ,C'5493'),             
       IFTHEN=(WHEN=GROUP,(34,4,CH,EQ,C'5003'))             
       IFTHEN=(WHEN=NONE,GROUP)                             
        OUTREC BUILD=(1,213)         



But getting below error

Code:
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 09:55 ON M
           SORT FIELDS=COPY                                               
           INREC IFTHEN=(WHEN=GROUP,BEGIN=(34,4,CH,EQ,C'5375'),           
                 IFTHEN=(WHEN=GROUP,(34,4,CH,EQ,C'5493'),                 
                 $                                                         
ICE006A 0 OPERAND DEFINER ERROR                                           
                 IFTHEN=(WHEN=GROUP,(34,4,CH,EQ,C'5003'))                 
                 $                                                         
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY     
                 IFTHEN=(WHEN=NONE,GROUP)                                 
                 $                                                         
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY     
                  OUTREC BUILD=(1,213)
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Mon Jan 20, 2014 1:37 pm
Reply with quote

Could you also provide the sample input data and expected output?
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 1:46 pm
Reply with quote

Sample Input
Code:
D|20140116|35|632005|04075731094|5793|NOUS|470010|01210289359|1|
D|20140116|35|632005|04071465178|5003|NOUS|470010|01329264876|2|
D|20140116|35|632005|04071465178|5493|NOUS|060060|01329264876|2|
D|20140116|35|632005|04071465178|5793|NOUS|470010|01329264876|2|
D|20140116|35|632005|04075731094|5493|NOUS|053252|00271335920|1|
D|20140116|35|632005|04068707957|5933|ONUS|077799|09077463290|3|
D|20140116|35|632005|04068707957|5264|ONUS|632005|04056129961|1|
D|20140116|35|430000|74000790060|5007|ROUS|632005|09167460568|2|
D|20140116|35|220323|62364820110|5003|ROUS|350000|09071676728|2|
D|20140116|35|632005|04068707957|5933|ONUS|099999|09090399682|2|



Sample output
now i want recotds like
5375
5375
5375
5493
5493
5003
5003
others not mentioned in condition

layout of input n output is same
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Mon Jan 20, 2014 1:55 pm
Reply with quote

Here is the sort card.

I believe, your input file is fixed and LRECL=213
Code:

SORT FIELDS=(214,1,CH,A)                                   
INREC IFTHEN=(WHEN=(34,4,CH,EQ,C'5375'),OVERLAY=(214:C'1')),
      IFTHEN=(WHEN=(34,4,CH,EQ,C'5493'),OVERLAY=(214:C'2')),
      IFTHEN=(WHEN=(34,4,CH,EQ,C'5003'),OVERLAY=(214:C'3')),
      IFTHEN=(WHEN=NONE,OVERLAY=(214:C'4'))                 
OUTREC BUILD=(1,213)                                       


input:
Code:

D|20140116|35|632005|04075731094|5793|NOUS|470010|01210289359|1|
D|20140116|35|632005|04071465178|5003|NOUS|470010|01329264876|2|
D|20140116|35|632005|04071465178|5493|NOUS|060060|01329264876|2|
D|20140116|35|632005|04071465178|5793|NOUS|470010|01329264876|2|
D|20140116|35|632005|04075731094|5493|NOUS|053252|00271335920|1|
D|20140116|35|632005|04068707957|5933|ONUS|077799|09077463290|3|
D|20140116|35|632005|04068707957|5264|ONUS|632005|04056129961|1|
D|20140116|35|430000|74000790060|5007|ROUS|632005|09167460568|2|
D|20140116|35|220323|62364820110|5003|ROUS|350000|09071676728|2|
D|20140116|35|632005|04068707957|5933|ONUS|099999|09090399682|2|


Since , there is no "5375" in the input, the output will be
output:
Code:

D|20140116|35|632005|04071465178|5493|NOUS|060060|01329264876|2|
D|20140116|35|632005|04075731094|5493|NOUS|053252|00271335920|1|
D|20140116|35|632005|04071465178|5003|NOUS|470010|01329264876|2|
D|20140116|35|220323|62364820110|5003|ROUS|350000|09071676728|2|
D|20140116|35|632005|04075731094|5793|NOUS|470010|01210289359|1|
D|20140116|35|632005|04068707957|5933|ONUS|099999|09090399682|2|
D|20140116|35|632005|04068707957|5933|ONUS|077799|09077463290|3|
D|20140116|35|632005|04068707957|5264|ONUS|632005|04056129961|1|
D|20140116|35|632005|04071465178|5793|NOUS|470010|01329264876|2|
D|20140116|35|430000|74000790060|5007|ROUS|632005|09167460568|2|


Hope this helps icon_smile.gif
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 2:57 pm
Reply with quote

Thank you so much suresh.
This woks perfectly for me
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top