Joined: 14 Oct 2004 Posts: 130 Topics: 43 Location: virtual village
Posted: Thu Feb 24, 2005 1:13 pm Post subject:
Thanks Kolusu, I fotgot to add onething to my first Q.
For converting
i/p fiel 1-9=numeric 10=space 11=numeric 12-50=space
o/p file 1-4=comp 5=space 6=numeric digit 7-50=spaces
i'm using the below and working fine.
SORT FIELDS=COPY
INREC FIELDS=(1:1,9,ZD,BI,5:10,1,6:11,1,7:12,44)
Then how to do this: (adding space end last 5 places)
i/p file 1-4=comp 5=space 6=numeric digit 7-50=spaces
o/p file 1-9=numeric 10=space 11=numeric 12-50=space _________________ Thanks
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Feb 24, 2005 1:25 pm Post subject:
Sarangadhar,
Quote:
Then how to do this: (adding space end last 5 places)
i/p file 1-4=comp 5=space 6=numeric digit 7-50=spaces
o/p file 1-9=numeric 10=space 11=numeric 12-50=space
Code your SORT Control cards as shown below
Code:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,4,BI,EDIT=(TTTTTTTTT), $ BI TO 9 DIGITS
10:X, $ SPACE
11:6,1, $ NUMERIC FROM POS 6
55:X) $ PAD SPACE UPTO BYTE 55
/*
Joined: 14 Oct 2004 Posts: 130 Topics: 43 Location: virtual village
Posted: Thu Feb 24, 2005 1:51 pm Post subject:
Thanks man. Working fine.
EDIT=(TTTTTTTTT) is like spanning into length of 9? or converting into numeric,
If I use
1:1,4,BI,ZD,LENGTH=9 for first filed its not giving correct digit at 9th place, why? _________________ Thanks
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Feb 24, 2005 2:03 pm Post subject:
A couple of comments:
A 4-byte BI value can give a maximum of 10 digits, not 9 (e.g. X'FFFFFFFF' is 4294967295 in decimal).
With DFSORT, 1,4,BI,ZD,LENGTH=9 will use an F sign for the last digit giving what I think you mean by "a correct digit". With Syncsort, 1,4,BI,ZD,LENGTH=9 will use a C sign for the last digit, giving what I think you mean by "an incorrect digit". So if you're getting an incorrect digit, you must be using Syncsort. Note that both F and C are valid ZD signs, but only F is displayable/printable.
For both products, EDIT=(TTTTTTTTT) gives 9 digits with an F sign for the last digit. TO=ZD,LENGTH=9 handles negative values (D sign). EDIT=(TTTTTTTTT) treats negative values as positive values (F sign).
Note that with DFSORT's Dec, 2004 PTF, you can now use ZDC to tell DFSORT to use a C sign or ZD or ZDF to tell DFSORT to use an F sign. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum