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
 

 

Grouping of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Grouping of records
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


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