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
 

 

Using SORT alone i need the output file as shown below

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Thu Mar 19, 2009 10:30 am    Post subject: Using SORT alone i need the output file as shown below
Reply with quote

Hi,

Below is my requirement using SORT

FILE1 :
AAA 1
AAA 2
AAA 3
BBB 1
BBB 3
BBB 6

using SORT alone i need the output file as shown below

FILE2 :
AAA 1 2 3
BBB 1 3 6

Regards
Saagu
Back to top
View user's profile Send private message

himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 19, 2009 10:33 am    Post subject:
Reply with quote

Have you searched it in the forum?
This has been discussed earlier..
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Thu Mar 19, 2009 10:34 am    Post subject: Reply to: SORT - Duplicates
Reply with quote

I could't find this in forum
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Mar 19, 2009 10:54 am    Post subject:
Reply with quote

Hi saagu
Is there any max limit for the no of records with same key.
i.e Max of how many records with a key 'AAA' can be present in the input file?
The output record length will vary on this right?
so, we should have some limit

You want to do this in Sort or in Rexx or you want to submit a sort step through rexx.
There are many topics disscussed on similar requirements in DFSORT/ICETOOL forum

Regards,
Balu
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 19, 2009 10:59 am    Post subject:
Reply with quote

Please refer this http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Thu Mar 19, 2009 11:07 am    Post subject:
Reply with quote

Hi VVmanyam,

Suppose if my limit is 10,can u please post the syntax using SORT.

Thanks for the reply
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Thu Mar 19, 2009 12:09 pm    Post subject: Reply to: Using SORT alone i need the output file as shown b
Reply with quote

If any posiibility please let me know.

Regards,
Saagu
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 19, 2009 7:54 pm    Post subject:
Reply with quote

Hello,

What have you found searching? Which sort product is used on your system?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Mar 19, 2009 9:07 pm    Post subject:
Reply with quote

Here is a SORT application that should produce your requested output:
Code:

//SORT  EXEC PGM=SORT,PARM='EQUALS'
//SORTIN  DD *                       
AAA 1                                 
AAA 2                                 
AAA 3                                 
BBB 1                                 
BBB 3                                 
BBB 6                                 
//SORTOUT DD SYSOUT=*                 
//SYSOUT  DD SYSOUT=*                 
//SYSIN   DD *                       
  SORT FIELDS=(1,3,CH,A)                         
  OUTREC IFTHEN=(WHEN=INIT,                     
    OVERLAY=(81:SEQNUM,2,ZD,RESTART=(1,3))),
    IFTHEN=(WHEN=(81,2,ZD,EQ,1),           
     BUILD=(1:1,3,4,2,18Z)),                 
    IFTHEN=(WHEN=(81,2,ZD,EQ,2),           
     BUILD=(1:1,3,2Z,4,2,16Z)),             
    IFTHEN=(WHEN=(81,2,ZD,EQ,3),           
     BUILD=(1:1,3,4Z,4,2,14Z)),             
    IFTHEN=(WHEN=(81,2,ZD,EQ,4),           
     BUILD=(1:1,3,6Z,4,2,12Z)),             
    IFTHEN=(WHEN=(81,2,ZD,EQ,5),           
     BUILD=(1:1,3,8Z,4,2,10Z)),             
    IFTHEN=(WHEN=(81,2,ZD,EQ,6),           
     BUILD=(1:1,3,10Z,4,2,8Z)),             
    IFTHEN=(WHEN=(81,2,ZD,EQ,7),           
     BUILD=(1:1,3,12Z,4,2,6Z)),             
    IFTHEN=(WHEN=(81,2,ZD,EQ,8),     
     BUILD=(1:1,3,14Z,4,2,4Z)),       
    IFTHEN=(WHEN=(81,2,ZD,EQ,9),     
     BUILD=(1:1,3,16Z,4,2,2Z)),       
    IFTHEN=(WHEN=(81,1,ZD,EQ,10),     
     BUILD=(1:1,3,18Z,4,2))           
  OUTFIL NODETAIL,REMOVECC,
    SECTIONS=(1,3,TRAILER3=(1,3,                 
         TOT=(4,2,BI,BI,LENGTH=2),     
         TOT=(6,2,BI,BI,LENGTH=2),     
         TOT=(8,2,BI,BI,LENGTH=2),     
         TOT=(10,2,BI,BI,LENGTH=2),     
         TOT=(12,2,BI,BI,LENGTH=2),     
         TOT=(14,2,BI,BI,LENGTH=2),     
         TOT=(16,2,BI,BI,LENGTH=2),     
         TOT=(18,2,BI,BI,LENGTH=2),     
         TOT=(20,2,BI,BI,LENGTH=2),     
         TOT=(22,2,BI,BI,LENGTH=2)))   
/*
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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