View previous topic :: View next topic
|
Author |
Message |
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|