View previous topic :: View next topic
|
Author |
Message |
manikanth_e
New User
Joined: 27 Mar 2007 Posts: 13 Location: chennai
|
|
|
|
Hi,
I have the input file. My output file should be formatted such a way that it should contain an extra field. This extra field should contain the sequence number (in decremented format).
I have tried with the below sort card:
Code: |
INREC FIELDS=(1:1,120,121:SEQNUM,15,ZD,START=50000000,INCR=-1)
OPTION COPY
|
But, I am resulted with syntax error.
Is there any way to do the same.
Thanks,
Mani |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
INCR=-1 is not valid. But you can do what you want by using
50000000-seqnum
where seqnum = 0, 1, ...
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/120)
//SORTOUT DD DSN=... output file (FB/135)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=135,
IFTHEN=(WHEN=INIT,
BUILD=(1,120,136:C'50000000',144:SEQNUM,8,ZD,START=0)),
IFTHEN=(WHEN=INIT,
OVERLAY=(121:136,8,ZD,SUB,144,8,ZD,TO=ZD,LENGTH=15))
/*
|
|
|
Back to top |
|
|
manikanth_e
New User
Joined: 27 Mar 2007 Posts: 13 Location: chennai
|
|
|
|
Frank,
Thanks alot for the reply.
Though you have mentioned ZD in the card, i am getting the output in the below format:
00000005000000{
00000004999999I
00000004999999H
00000004999999G
00000004999999F
00000004999999E
00000004999999D
00000004999999C
00000004999999B
00000004999999A
00000004999999{
00000004999998I
00000004999998H
May i know the reason for the same? How to get in the proper format?
Thanks,
Mani. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The DFSORT job I showed gives readable values like 000000050000000. The values you're getting indicates you're using Syncsort (WER messages), not DFSORT (ICE messages). DFSORT uses an F sign for the ZD result to give readable values whereas Syncsort uses a C sign for the ZD result to give unreadable values.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What will be the use of these decremented sequence numbers?
If they are to be used in some code or utility, those values are valid numbers. They aren't as easy to read manually, but will work correctly if used as data in a compare or a report. Actually, if they are reported as numbers, the output should look as you'd prefer. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
I know this is dirty solution but still-
1. Sort the file in reverse order
2. add sequence numbers to its record in normal asending order.
3. sort it back to original order. |
|
Back to top |
|
|
|