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
 

 

SORT Help

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

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Fri Dec 04, 2009 3:21 pm    Post subject: SORT Help
Reply with quote

I have a input file

Code:

T11/02/20091FBCL             2568946565
T11/02/20091FB               2514337958
T11/02/20091FBCL             2564924580
T10/31/20091FBCL             2054026498
B10/29/20091FBCL             2054779006
B11/02/20091FBCL             2516216620
T10/30/20091FBCL             2059398882
T10/07/20091FBCL             3347457800
B11/02/2009BSLDX             2568917600
T11/02/2009ASB               2513439978
T10/03/20091FBCL             2568451694
B11/02/20091FB               2513410244
I11/02/2009BVBMP             2562379408
B11/02/2009B1M               2056813276
T11/02/2009BSLD2             2567964449
B11/02/2009BF2CL             2053222522
T11/02/20091FBCL             2568290311


Rules to Sort is if the First Charachter is B then SORT by 12 to 16 and 30 to 39 else sort by 12 to 16 only.

How can I do it in single sort control card?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 04, 2009 3:43 pm    Post subject:
Reply with quote

Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and should be posted in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


You also need to provide more detail than you already have.

What is the DSORG, RECFM & LRECL of the input and output files.

This is a link to the DFSORT smart tricks documentation which has examples of doing a great many things using DFSORT and ICETOOL. I do not know if the solution you are searching is contained in here, but this is a highly useful piece of documentation which may be invaluable in the future for other requirements.
Please click HERE to access it.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Dec 04, 2009 4:26 pm    Post subject:
Reply with quote

Do you want to include first charactor also as part of keys?
It would be great if you could show us output for above give example by you.
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Fri Dec 04, 2009 4:47 pm    Post subject: Reply to: SORT Help
Reply with quote

yes the first character should be include as a part of key.
Sorry I don't have the output of the example. I want the same from SORT.

Thanks
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: Fri Dec 04, 2009 10:48 pm    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
T11/02/20091FBCL             2568946565
T11/02/20091FB               2514337958
T11/02/20091FBCL             2564924580
T10/31/20091FBCL             2054026498
B10/29/20091FBCL             2054779006
B11/02/20091FBCL             2516216620
T10/30/20091FBCL             2059398882
T10/07/20091FBCL             3347457800
B11/02/2009BSLDX             2568917600
T11/02/2009ASB               2513439978
T10/03/20091FBCL             2568451694
B11/02/20091FB               2513410244
I11/02/2009BVBMP             2562379408
B11/02/2009B1M               2056813276
T11/02/2009BSLD2             2567964449
B11/02/2009BF2CL             2053222522
T11/02/20091FBCL             2568290311
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION EQUALS
  INREC IFOUTLEN=80,
   IFTHEN=(WHEN=(1,1,CH,EQ,C'B'),OVERLAY=(81:30,10))
  SORT FIELDS=(1,1,CH,A,12,5,CH,A,30,10,CH,A)


SORTOUT will have:

Code:

B11/02/2009BF2CL             2053222522   
B11/02/2009BSLDX             2568917600   
B11/02/2009B1M               2056813276   
B11/02/20091FB               2513410244   
B10/29/20091FBCL             2054779006   
B11/02/20091FBCL             2516216620   
I11/02/2009BVBMP             2562379408   
T11/02/2009ASB               2513439978   
T11/02/2009BSLD2             2567964449   
T11/02/20091FB               2514337958   
T10/31/20091FBCL             2054026498   
T10/30/20091FBCL             2059398882   
T11/02/20091FBCL             2564924580   
T11/02/20091FBCL             2568290311   
T10/03/20091FBCL             2568451694   
T11/02/20091FBCL             2568946565   
T10/07/20091FBCL             3347457800   
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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