Absinthia
New User
Joined: 10 Jan 2008 Posts: 36 Location: CHINA
|
|
|
|
Hi,everyone,I have a dataset like this.
Code: |
mm 1 abcd 2008-03-21
mm 3 abcd 2008-03-21
mm 4 abcd 2008-03-21
mm 1 abcd 2008-03-21
mm 3 abcd 2008-03-21
mm 4 abcd 2008-03-21 |
I want to use ICETOOL to make the dataset like this
Code: |
mm 1 abcd 2008-03-21
mm 4 abcd 2008-03-21
mm 3 abcd 2008-03-21
mm 1 abcd 2008-03-21
mm 4 abcd 2008-03-21
mm 3 abcd 2008-03-21 |
Maybe it is a little tricky,could anyone help me with it? |
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Maybe it is a little tricky,could anyone help me with it? |
Maybe there needs to be a better definition of the requirement. . .
You show the "4"s being sorted ahead of the "3"'s and otherwise nothing changes. I suspect that the data posted is not representative of all of the data that might be in the input.
What needs to happen if there are 2's, 5's etc in the input? Is that "field" only 1 byte long?
Please post all of the "rules" for your reqirement as well as some more comprehensive data.
Also, post the recfm and lrecl of the input and output along with the columns that contain "control" information. |
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//ALTSEQ EXEC PGM=SORT
//SORTIN DD *
MM 1 ABCD 2008-03-21
MM 3 ABCD 2008-03-21
MM 4 ABCD 2008-03-21
MM 1 ABCD 2008-03-21
MM 3 ABCD 2008-03-21
MM 4 ABCD 2008-03-21
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=(4,1,CH,EQ,C'1'),
OVERLAY=(81:SEQNUM,3,ZD,START=1,INCR=3)),
IFTHEN=(WHEN=(4,1,CH,EQ,C'3'),
OVERLAY=(81:SEQNUM,3,ZD,START=3,INCR=3)),
IFTHEN=(WHEN=(4,1,CH,EQ,C'4'),
OVERLAY=(81:SEQNUM,3,ZD,START=2,INCR=3))
SORT FIELDS=(81,3,BI,A)
OUTREC BUILD=(1,80)
|
Gerry |
|