Posted: Fri May 16, 2008 7:39 am Post subject: Supress zero & Convert Editing field to Assumd decimal p
Hi,
Sorry, if already this problem is resolved by Forums. Here the problem is,
I want to filter the Editing numeric filed to implicit numeric form. We got the pricing records thru Excel Spreadsheet, FTP transfer these records to Mainframe dataset. Problem is, when the customer sends the fields by preceding and succeeding zeros, our program is treat as new pricing. Say eg:
Code:
Name Price ZIP
XXXX 0012.10 20087
AAAA 0123.20 20900
KKKK 0007.70 21244
Our program will not treat the price 12.10 is same as 0012.10, mean it will not suppress the prefix and suffix zeros after the decimal point.
Our goal is, convert the 0012.10 to a numeric field 9999.99 (Implicit decimal ie., S9(4)v99). For our computing purpose. I read we can do sort, Please help me, i'm new to mainframe field.
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Fri May 16, 2008 8:20 am Post subject:
This probably should be in the Programming section or Utilities section but certainly not the JCL section.
All the same - what are your field definitions for this data. It looks as though you may be using a character field rather than a numeric field. If you want an assumed decimal point and the input has a real decimal point then you need to read it into an edited numeric field then move it to an unedited numeric field. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Thanks, i suppose to post this conversation in the utilities Page. Well.
Our JOB flow is FTP send the dataset to EZTRIVE job to compare the price. But this EZT, have problem with comparing the 12.10 and new pricing 0012.10. Since both are same, but our EZT step treat as differnt records.
This point we dont want to change the EZTRIVE Program, instead write a sort, utility - reformat logic to supress the preceding and succeeding zeros in the price field.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri May 16, 2008 9:56 am Post subject:
sabarisavi,
Your posts are quite confusing. I am not sure what you are trying to do. However I am guessing that the excel file is ftp'd with tab delimiter and the postion of the numeric field varies . If that is the case then we need to use PARSE function to edit the numeric fields. Let us know and we will show you an example as to how to do it
Just show us how the input file Mainframe looks like
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
Posted: Fri May 16, 2008 11:47 am Post subject:
In your input file unit dosage appears to be a 7 byte alphanumeric field not 11. And you are not supressing the leading or trailing zeros but adding them. That may be what is confusing people.
Intially we thought to supress but future reference we have to keep leading and trailing zeros.
From my Input, Since text file made up with balnks. so FTP retreive the same.
It is sure, Unit Dosage is a 11 byte made up with blank spaces, it is not 7 byte. Here it shows bytes 7 but with preceeding and trailing blank ( spaces).
The first %00 operates starts scanning the input record from position 8 in the input file and it stops when it encounters the decimal dot , and the next %01 grabs the 3 bytes after the decimal dot
Check this link which explains in detail about UFF and SFF
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri May 16, 2008 4:32 pm Post subject:
sabarisavi,
That is a weird way of representing the decimals. why would '10 ' considered as 100 ?. He already gave a zero why not give the other zero also ? Anyway change your control cards to the following and it will give you the desired results. We basically use ALTSEQ to convert any spaces to '0' for decimals
Thanks. It is working fine. I hope, there is some miscommunication some where. Well,
FYI - We expect the output becomes .100 not for .010 thats what i meant, after decimal if any zero come followed by any number, the value is different rather than zero preceed the decimal point.
How ever, your new approch is working fine, but i dont know what is wrong with the old approch, ie.,
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri May 16, 2008 6:24 pm Post subject:
sabarisavi wrote:
your new approch is working fine, but i dont know what is wrong with the old approch,
sabarisavi,
The old approach is considering the the field after dot as UFF (unsigned free form numeric) which would extract decimal digits (0-9) from right to left anywhere in the field to form a positive number. Any combination of characters is valid, but characters other than 0-9 are ignored.
So the spaces are ignored and hence 10 followed by a space is treated as just 10. The new approach is using ALTSEQ to replace spaces with zero. So a 10 followed by space is changed to 100. The last zero is from TRAN function which converted the space to zero.
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