View previous topic :: View next topic
|
Author |
Message |
surendra_giddaluru
New User
Joined: 17 May 2007 Posts: 8 Location: chennai
|
|
|
|
Hi,
I need to alter the sequence of records. Below are the input file records:
0000M001A
0000M001B
0000M001C
0000M001D
0000M001E
0000M001F
0000M001G
0000M001H
0000M001I
0000M001J
0000M001K
0000M001L
0000M001M
0000M001Q
0000M001R
0000M001Z
0000M002A
0000M002B
0000M002C
0000M002D
0000M002E
0000M002F
0000M002G
0000M002H
0000M002I
0000M002J
0000M002K
0000M002L
0000M002M
0000M002Q
0000M002R
0000M002Z
and my desired output needs to be as follows:
0000M001A
0000M001B
0000M001C
0000M001D
0000M001E
0000M001F
0000M001G
0000M001H
0000M001I
0000M001J
0000M001K
0000M001L
0000M001M
0000M001Q
0000M001R
0000M001Z
0000M002A
0000M002B
0000M002C
0000M002D
0000M002E
0000M002F
0000M002G
0000M002H
0000M002I
0000M002J
0000M002K
0000M002L
0000M002M
0000M002Z
0000M001Q
0000M001R
0000M002Q
0000M002R
Please help me…
Thanks in advance
Surendra. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you need to add an extra field. OVERLAY on INREC
the field to be 0 when value of is not
0000M001Q
0000M001R
0000M002Q
0000M002R
the field to be 1 when value of is
0000M001Q
0000M001R
0000M002Q
0000M002R
Then sort keys would be extra field, normal field
drop the extra field on OUTREC. |
|
Back to top |
|
|
surendra_giddaluru
New User
Joined: 17 May 2007 Posts: 8 Location: chennai
|
|
|
|
Hi,
Thanks for your reply. I need to bring down all the 'Q' and 'R' records at the end of all records. For example if have another account records like
0000M003A
0000M003B
0000M003C
0000M003D
0000M003E
0000M003F
0000M003G
0000M003H
0000M003I
0000M003J
0000M003K
0000M003L
0000M003M
0000M003Q
0000M003R 0000M003Z
then my output should be
0000M001A
0000M001B
0000M001C
0000M001D
0000M001E
0000M001F
0000M001G
0000M001H
0000M001I
0000M001J
0000M001K
0000M001L
0000M001M
0000M001Q
0000M001R
0000M001Z
0000M002A
0000M002B
0000M002C
0000M002D
0000M002E
0000M002F
0000M002G
0000M002H
0000M002I
0000M002J
0000M002K
0000M002L
0000M002M
0000M002Z
0000M003A
0000M003B
0000M003C
0000M003D
0000M003E
0000M003F
0000M003G
0000M003H
0000M003I
0000M003J
0000M003K
0000M003L
0000M003M
0000M003Z
0000M001Q
0000M001R
0000M002Q
0000M002R
0000M003Q
0000M003R
Please let me kno if you need any more clarification.
Thanks,
Surendra. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=.. input file (FB/80)
//SORTOUT DD DSN=.. output file (FB/80)
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'0')),
IFTHEN=(WHEN=(9,1,SS,EQ,C'QR'),OVERLAY=(81:C'1'))
SORT FIELDS=(81,1,CH,A,1,9,CH,A)
OUTREC BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
surendra_giddaluru
New User
Joined: 17 May 2007 Posts: 8 Location: chennai
|
|
|
|
Hi Frank,
Thank you!!!
Thanks,
Surendra. |
|
Back to top |
|
|
|