now the converted field is appearing in the file as follows
MD---21212
NC---28105
LA---70130
LS---70130
the one showed in bold is converted field.
but i want it to be left justified. ie if we take the first one as example , it should be like MD21212---
is there any way to do this??
I went thru the editting characters to see wether we can do this. but i couldnt find it.
thanks
doubt_man
A couple of errors in your sort card. First thing is you don't have 3 bytes of binary field. BInary field can be 2,4, 8 bytes. so first check that.
You used edit mask iiii which means to supress the leading zero. If you want the number then you just put all TTTTTTT which will print the number.Try the following sort card.
hi kolsu,
thanks for the response. but the problem is that if we use EDIT=(TTTTTTTTT) the output will be (if we take the first record) MD00021212 . but i dont want that. The real problem is that i want to load the ouptput of this step to the database. so if the field is ---21212 , we cannot give a querry based on that.( This happens to be the zip code). so if in a querry we give WHERE ZIP='21212', it would not get me the row. thats why i am trying to put the number first followed by the spaces(in this case 21212---). i think you understand the requirement.
And regarding the error in the sort card, i wonder how it worked earlier. Actually the first and third line of the sort card ie
hi kolusu,
sorry. that was a typo.
The problem is that the max value is not always 5 bytes. sometimes a zip extension will come. so we cannot put 5T's. is there any other way??
thanks
doubt_man
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Mar 30, 2004 11:25 am Post subject:
Kolusu said
Quote:
First thing is you don't have 3 bytes of binary field. BInary field can be 2,4, 8 bytes. so first check that.
Kolusu,
A 3-byte BI field is fine in the SORT statement (it's the SUM statement that only allows 2, 4 or 8 bytes). _________________ 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
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Mar 30, 2004 11:29 am Post subject:
doubt man,
You're not making it clear what you want to do. You showed xx---ddddd and asked how to make it xxddddd. Kolusu showed you how to do that. Then you said the max value is not always 5 bytes. It's unclear what that means. Please show an example of your input and what you want the output to look like that tells us what exactly you want to do that Kolusu's response doesn't cover. _________________ 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
hi frank,
i wil make it more clear. if i change it like what kolsu has said, it will work fine only if we are recieving a 5 byte zipcode in the input. But that is not the case always . sometimes we will have a zip extension which will increase the no of bytes of the field to 6 or 7. so if we give it
SORT FIELDS=(1,03,CH,A)
OUTREC FIELDS=(1,107,
108,5,PD,EDIT=(TTTTT),
4X,
113,49,
C'1100')
if the input field is comming as 1121212, then according to this we will get only
21212.
sample input of special case(in which zip extension is included)
This is the input when i gave a hex on(as input is in pd)
MD
DC01222
440111F
The field following 'MD' is the zip which is in discussion.
REQUIRED OUTPUT
MD1121212
PRESENT OUTPUT
MD21212
i think it is clear now.
please get back to me if something more is to be clarified.
thanks
doubt_man.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Mar 31, 2004 9:31 am Post subject:
Doubtman,
The following JCl will give you the desired results. A brief explanation of the JOb. We first reformat the zip field to 9 bytes using the outrec fields. Using Outfil fnames we split the file into 2 seperate files. One files will have all the records which have an extension for the zip and the other which does not have extension. The no extension records are now aligned to remove the leading zeroes and pad spaces to right of zip code using outrec.
The second step concatenates these 2 files together and sorts on the key.
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