View previous topic :: View next topic |
Author |
Message |
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Wed Mar 03, 2004 9:58 am Post subject: SORT utility for Siebel columns |
|
|
Hi,
I want to sort a COBOL file based on the Siebel column which is of type UTC date/time.(date and time combined). This column contain values like this 2003-11-12-10.14.36.000000
Can I do it using standard SORT utility like
SORT FIELDS=(1,26,CH,A)
Instead of CH do I need to use some other parameter value.
It would be great if someone can give any idea in this regard |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Mar 03, 2004 10:01 am Post subject: |
|
|
Sk,
You are fine sorting the field as character.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Wed Mar 03, 2004 2:21 pm Post subject: |
|
|
Kolusu,
Sort for the above mentioned column is not working correctly and the output is as follows:
2004-02-23-12.11.57.000000
2004-02-18-08.33.28.000000
2004-03-03-08.03.35.000000
2004-02-20-12.28.57.000000
2004-02-25-09.08.08.000000
Could you tell me whether i need to change some parameters or anything to sort it correctly. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Mar 03, 2004 2:28 pm Post subject: |
|
|
Sk,
when you say it is not working properly, you need give more information.I just ran the job and it sorted correctly
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2004-02-23-12.11.57.000000
2004-02-18-08.33.28.000000
2004-03-03-08.03.35.000000
2004-02-20-12.28.57.000000
2004-02-25-09.08.08.000000
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,26,CH,A)
//*
|
The output is:
Code: |
2004-02-18-08.33.28.000000
2004-02-20-12.28.57.000000
2004-02-23-12.11.57.000000
2004-02-25-09.08.08.000000
2004-03-03-08.03.35.000000
|
Just cut and paste the same job on to your machine and look at sortout in SDSF. you will find the results are sorted correctly
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Mar 03, 2004 3:23 pm Post subject: |
|
|
I got the exact same results as Kolusu.
Maybe the start position for the field is not in byte 1?
This code will show the contents of the specified bytes:
Code: |
//STEP0200 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//SORTIN DD DSN=dataset
//DFSMSG DD SYSOUT=*
//SHOW DD SYSOUT=*
//TOOLIN DD *
DISPLAY FROM(SORTIN) LIST(SHOW) ON(1,26,HEX)
//*
|
|
|
Back to top |
|
|
haatvedt Beginner
Joined: 14 Nov 2003 Posts: 66 Topics: 0 Location: St Cloud, Minnesota USA
|
Posted: Thu Mar 04, 2004 3:50 pm Post subject: |
|
|
if the file is variable length, then the RDW (Record Descriptor Word) is included in the position field of the sort control cards. For example the first data byte is in position 5 as the length of the RDW is 4 bytes. _________________ Chuck Haatvedt
email --> clastnameatcharterdotnet
(replace lastname, at, dot with appropriate
characters) |
|
Back to top |
|
|
|
|