Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us