Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To validate the Decimal numeric check
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Fri Jan 24, 2014 4:19 pm    Post subject: To validate the Decimal numeric check
Reply with quote

Hi,

I want to omit the records in the file which has incorrect data in the amount field.

For example:

0002QQ2D1126287992496592032013081420131013 120.00EAUSD
0002CCAO1126287992496592032014011120151013 2000.00EAUSD
0002CCAO1126287992457592032014012420151013 20.00 EAUSD
0002CCAO1126287992457592032014012620151013800 12000.45EAUSD
0002CCAO1126287992457592032014010220151013 111100.AAEAUSD
0002CCAO1126287992457592032014010220151013825600 .00EAUSD

Field starting from 43
Length ==> 13

I need the records in the output file:

0002CCAO1126287992496592032013081420131013 120.00EAUSD
0002CCAO1126287992496592032014011120151013 2000.00EAUSD


I have tried to omit the invalid records using sort - Zoned decimal numeric check, but i could not able to get the required output.

Kindly help me on this.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Fri Jan 24, 2014 4:28 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

when posting data good manners suggest the use of code tags,
to preserve the alignment and making easier to identify the columns

also a ruler would be welcome

Code:

         1         2         3         4         5         6         7         8
....+....+....+....+....+....+....+....+....+....+....+....+....+....+....+....+
0002QQ2D1126287992496592032013081420131013 120.00EAUSD
0002CCAO1126287992496592032014011120151013 2000.00EAUSD
0002CCAO1126287992457592032014012420151013 20.00 EAUSD
0002CCAO1126287992457592032014012620151013800 12000.45EAUSD
0002CCAO1126287992457592032014010220151013 111100.AAEAUSD
0002CCAO1126287992457592032014010220151013825600 .00EAUSD

Field starting from 43
Length ==> 13

I need the records in the output file:

Code:

         1         2         3         4         5         6         7         8
....+....+....+....+....+....+....+....+....+....+....+....+....+....+....+....+
0002CCAO1126287992496592032013081420131013 120.00EAUSD
0002CCAO1126287992496592032014011120151013 2000.00EAUSD
 
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Fri Jan 24, 2014 5:02 pm    Post subject:
Reply with quote

Code:


 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000200 0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD           
 000300 0002CCAO1126287992496592032013081420131013       120.00EAUSD           
 000320 0002CCAO1126287992457592032014012420151013      20.00  EAUSD           
 000330 0002CCAO1126287992457592032014012620151013800  12000.45EAUSD           
 000340 0002CCAO1126287992457592032014010220151013    111100.AAEAUSD           
 000350 0002CCAO1126287992457592032014010220151013825600    .00EAUSD           
 ****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Fri Jan 24, 2014 5:05 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Input field:

Code:
000200 0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD     
000300 0002CCAO1126287992496592032013081420131013       120.00EAUSD     
000320 0002CCAO1126287992457592032014012420151013      20.00  EAUSD     
000330 0002CCAO1126287992457592032014012620151013800  12000.45EAUSD     
000340 0002CCAO1126287992457592032014010220151013    111100.AAEAUSD     
000350 0002CCAO1126287992457592032014010220151013825600    .00EAUSD     
Output field

Code:
000001 0002CCAO1126287992496592032013081420131013       120.00EAUSD   
000002 0002CCAO1126287992496592032014011120151013      2000.00EAUSD   
000003                                                                 
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Jan 24, 2014 7:00 pm    Post subject:
Reply with quote

What are the rules?

Please explain
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Fri Jan 24, 2014 7:10 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Using Sort, want only the correct amount values in the output field.

Like the below amount values should be omitted


Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6--
****** ***************************** Top of Data ********************
000320 0002CCAO1126287992457592032014012420151013      20.00  EAUSD 
000330 0002CCAO1126287992457592032014012620151013800  12000.45EAUSD 
000340 0002CCAO1126287992457592032014010220151013    111100.AAEAUSD 
000350 0002CCAO1126287992457592032014010220151013825600    .00EAUSD 


 


In the first data, the decimal point appeared in the wrong place
second data, space appearing in mid of the amount value
third data, non-numeric value appears 54 and 55th position
fourth data, there is an space appears in the amount value.

Amount value: starts at 43th position
Length is 13

Wanted only the correct output values in the output file.

Code:

----+----1----+----2----+----3----+----4----+----5----+----6-
***************************** Top of Data *******************
0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD
0002CCAO1126287992496592032013081420131013       120.00EAUSD
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Jan 24, 2014 8:02 pm    Post subject:
Reply with quote

Your input and output doesnt match

icon_sad.gif
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Fri Jan 24, 2014 8:09 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Sorry.

Please find the files below.

Input file:
Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6--
****** ***************************** Top of Data ********************
000200 0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD 
000300 0002CCAO1126287992496592032013081420131013       120.00EAUSD 
000320 0002CCAO1126287992457592032014012420151013      20.00  EAUSD 
000330 0002CCAO1126287992457592032014012620151013800  12000.45EAUSD 
000340 0002CCAO1126287992457592032014010220151013    111100.AAEAUSD 
000350 0002CCAO1126287992457592032014010220151013825600    .00EAUSD 


Ouput file:
Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+--
****** ***************************** Top of Data *************************
000200 0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD       
000300 0002CCAO1126287992496592032013081420131013       120.00EAUSD       
****** **************************** Bottom of Data ***********************

Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Jan 25, 2014 1:55 am    Post subject:
Reply with quote

Meenakshi Selvaraj,

1. Use an INCLUDE COND looking for dot at position 53 AND check the 2 bytes at position 54 with FS format for NUM

2. Use Parse on INREC to parse the data with ABSPOS=43 and FIXLEN=10 looking for ENDAT=c' ' and OVERLAY that parse field at the LRECL+1 if the input format is FB or use BUILD with RDW, Parse field, start pos of Variable record if the input is VB

3. Use OUTFIL OMIT to check the overlay/build field Greater than spaces and use BUILD to remove the parse field which will give you the desired results.
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Mon Jan 27, 2014 11:47 am    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Hi Skolusu,


Thanks.

I have tried using the details given but i couldnt able to get the desired result.

Could you please provide the syntax for this.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Jan 27, 2014 11:56 am    Post subject:
Reply with quote

Please post the code which you tried?
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Mon Jan 27, 2014 12:13 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Syntax used in the Sort card as

Code:

    SORT FIELDS=COPY                       
    INCLUDE COND=(53,01,CH,EQ,C'.',AND,   
                  54,02,FS,EQ,NUM)         


i got the Output as

Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+--
****** ***************************** Top of Data *************************
000200 0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD       
000300 0002CCAO1126287992496592032013081420131013       120.00EAUSD       
000330 0002CCAO1126287992457592032014012620151013800  12000.45EAUSD       
000350 0002CCAO1126287992457592032014010220151013825600    .00EAUSD       
****** **************************** Bottom of Data ***********************
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Jan 27, 2014 12:55 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

You forgot to code the 2nd and third stages. You need a PARSE, as described, and OUTFIL OMIT= as described,

Tighten up your test data as well.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Mon Jan 27, 2014 1:21 pm    Post subject:
Reply with quote

Hi Meenakshi,

Here is the code that Kolusu explained. I assumed your file is FB and LRECL=80.
Code:

//STEP0001 EXEC PGM=SORT                                   
//SORTIN   DD *                                             
0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD
0002CCAO1126287992496592032013081420131013       120.00EAUSD
0002CCAO1126287992457592032014012420151013      20.00  EAUSD
0002CCAO1126287992457592032014012620151013800  12000.45EAUSD
0002CCAO1126287992457592032014010220151013    111100.AAEAUSD
0002CCAO1126287992457592032014010220151013825600    .00EAUSD
//SORTOUT  DD SYSOUT=*                                     
//SYSOUT   DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  INCLUDE COND=(53,1,CH,EQ,C'.',AND,54,2,FS,EQ,NUM)         
  OUTREC PARSE=(%01=(ABSPOS=43,FIXLEN=10,ENDAT=X'40')),     
         OVERLAY=(81:%01)                                   
  OUTFIL OMIT=(81,1,CH,GT,X'40'),
         BUILD=(1,80)                         


and output is
Code:
0002SD HCENGINE  RU0005   2013081999991231      2000.00EAAUD                   
0002CCAO1126287992496592032013081420131013       120.00EAUSD                   


Kolusu,
please check if I missed anything. icon_redface.gif
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Mon Jan 27, 2014 1:32 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Thank you so much.

It works as per the requirement.
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Mon Jan 27, 2014 3:04 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Hi,

Need one more clarifications

Input file:

Code:

 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001 0002GPSAR7001CART1234567892013033099991212A111111100.00PCUSD           
 000002 0002GPSAR7002CART1234567892013033099991212       100.00PCUSD           
 000003 0002GPSAR7003CART1234567892013033099991212       200.00PCUSD           
 000004 0002GPSAR7003CART1234567892013033099991212 300   200.00PCUSD           
 000005 0002GPSAR7003CART12345678920130330999912121111111100.AAPCUSD           
 000006 0002GPSAR7003CART1234567892013033099991212  100.00     PCUSD           
 000007 0002GPSAR7003CART1234567892013043099991212  5000 78 .44PCUSD           
 000008 0002GPSAR7003CART1234567892013011099991212995000 78 .44PCUSD           


Using the same sort card, but i got different output

Output file:
Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 0002GPSAR7002CART1234567892013033099991212       100.00PCUSD           
000002 0002GPSAR7003CART1234567892013033099991212       200.00PCUSD           
000003 0002GPSAR7003CART1234567892013033099991212 300   200.00PCUSD           
000004 0002GPSAR7003CART1234567892013043099991212  5000 78 .44PCUSD           
****** **************************** Bottom of Data ****************************


Actually the 2nd and 3rd records are needed.
Apart from non-numeric,
Requirement is, if there is any spaces in between the amount value, then that record should be removed.
In the input file, 8th record is removed. Like that 4th and 7th records are also need to remove. But it is not.

Could you please explain why this sort card is not working for these records too.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Jan 27, 2014 3:18 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

The Control Cards dealt with the situation you showed.

I was suspicious, but if your test data was representative, you'd be OK. Is it yet good enough? What about multiple ".", for instance? If it is raw user-data, you have to cover everything.

With what you have been shown already, you should be able to come up with something.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Jan 27, 2014 4:43 pm    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

I wonder why people have to waste time checking over and over the data they receive

one of the first paradigms of quality is that
THE PROVIDER IS RESPONSIBLE OF THE DATA QUALITY/CORRECTNESS NOT THE RECEIVER

looks like good practices are going down the toilet nowadays

have the morons fix the data they provide You
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jan 27, 2014 11:48 pm    Post subject: Re: Reply to: To validate the Decimal numeric check
Reply with quote

Meenakshi Selvaraj wrote:
Could you please explain why this sort card is not working for these records too.


Meenakshi Selvaraj,

If only you could explain as to why you haven't included the new test data earlier , we would explain as to why the other solution did not work.
Back to top
View user's profile Send private message
Meenakshi Selvaraj

New User


Joined: 30 Oct 2009
Posts: 36
Location: Chennai

PostPosted: Tue Jan 28, 2014 11:25 am    Post subject: Reply to: To validate the Decimal numeric check
Reply with quote

Hi Skolusu,

I got the data from different team. Earlier i dont know whether we can have these types of data.

But using cobol program, i have validate all these conditions. Eager to learn whether all these are acheived by using sort card. Hence i dropped the question here. Anyhow completed using Cobol.

Thanks for your help and time.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us