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
 

 

Validating File using DFSORT/ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Varun Sethi

New User


Joined: 03 Apr 2014
Posts: 6
Location: india

PostPosted: Thu Apr 03, 2014 3:52 pm    Post subject: Validating File using DFSORT/ICETOOL
Reply with quote

I have the file with the below data.

Code:
1000913890008964710000000002500
1000913890008964810000000002500
1000913890008964910000000002500
1000913890008965110000000002500
1000913890008965710000000002500
2000913890000000012500
1000914890008966710000000003000
1000914890008967710000000003000
1000914890008968710000000003000
1000914890008969710000000003000
1000914890008974710000000003000
2000914890000000015000
9000001000000020000000027500


File has three types of records (record type 1 ,2 & 9) and first character is used to identify the record type. Record type 1 has an amount which starts from position 20 and length is 13 bytes.

Record type 9 contains the count of record type 1 (starts from position 2 and takes 7 bytes), count of record type 2 (starts from position 9 and takes 7 bytes) and the sum total of amount field for record type 1.

Is there any way we can validate the input file i.e. the count of record type 1 and total of record type with info present in record type 9 of the file? If yes then please can you provide the sample sort JCL to achieve this?

Code'd
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Thu Apr 03, 2014 6:22 pm    Post subject: Reply to: Validating File using DFSORT/ICETOOL
Reply with quote

What happens to this dataset after validation? Does it go into another program? If so, then that program needs to do the validation. If the file is not processed further but sent elsewhere then it should have headers and trailers (it should have these anyway) so that the remote program can validate it.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Apr 03, 2014 8:00 pm    Post subject:
Reply with quote

Quote:
Is there any way we can validate the input file i.e. the count of record type 1 and total of record type with info present in record type 9 of the file?


What is the position in record type 9 which gives the count of type 1? Please give us a sample example which explains the need clearly.
Back to top
View user's profile Send private message
Varun Sethi

New User


Joined: 03 Apr 2014
Posts: 6
Location: india

PostPosted: Thu Apr 03, 2014 8:42 pm    Post subject: Reply to: Validating File using DFSORT/ICETOOL
Reply with quote

The example is given in my post. The count starts from position 2 and length of counter field is 7 bytes. If you refer to the sample data u will notice the count value as 10 starting from 2nd byte. Let me know if it is still not clear.
Back to top
View user's profile Send private message
Varun Sethi

New User


Joined: 03 Apr 2014
Posts: 6
Location: india

PostPosted: Thu Apr 03, 2014 8:51 pm    Post subject: Reply to: Validating File using DFSORT/ICETOOL
Reply with quote

Nic, the file will be going to another program but I want to do generic validation first before we process the file and that validation is to cross check the count of record type 1 with the values present in record type 9.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Thu Apr 03, 2014 9:26 pm    Post subject: Reply to: Validating File using DFSORT/ICETOOL
Reply with quote

Well, that validation (which is specific, not generic) is a task of the program that reads the data and is one of the tasks of every program - validate the input as necessary. That task should not be 'out-sourced'. Anything could happen between the sort validating it and the program reading it.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Apr 03, 2014 10:13 pm    Post subject: Re: Reply to: Validating File using DFSORT/ICETOOL
Reply with quote

Varun Sethi wrote:
Nic, the file will be going to another program but I want to do generic validation first before we process the file and that validation is to cross check the count of record type 1 with the values present in record type 9.


It can be validated and what do you need to do if they match and what do you need to do if they don't match? Set a return code?
Back to top
View user's profile Send private message
Varun Sethi

New User


Joined: 03 Apr 2014
Posts: 6
Location: india

PostPosted: Thu Apr 03, 2014 11:44 pm    Post subject: Reply to: Validating File using DFSORT/ICETOOL
Reply with quote

if the count and the total doesn't match then i would like to set the return code or abend.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Apr 04, 2014 2:48 am    Post subject:
Reply with quote

varun sethi,

Please do NOT send private messages seeking help. Please post all your questions on the helpboard itself.

Use the following control cards to abend the step if any of the counts or amt total is off.

Code:

//SYSIN    DD *                                   
  DEBUG ABEND                                     
                                                   
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),             
  BUILD=(X,6C'0',C'1',3C'0000000',20,13,13C'0')), 
  IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),                   
  BUILD=(X,7C'0',6C'0',C'1',2C'0000000',26C'0')), 
  IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),                   
  BUILD=(X,14C'0',2,14,13C'0',16,13))             
                                                   
  SORT FIELDS=(1,1,CH,A)                           
                                                   
  SUM FIELDS=(02,07,ZD,                           
              09,07,ZD,                           
              16,07,ZD,                           
              23,07,ZD,                           
              30,13,ZD,                           
              43,13,ZD)                           
                                                   
   OUTFIL NULLOFL=RC16,                           
   INCLUDE=(02,07,CH,EQ,16,07,CH,AND,             
            09,07,CH,EQ,23,07,CH,AND,             
            30,13,CH,EQ,43,13,CH)                 
                                                   
//*
Back to top
View user's profile Send private message
Varun Sethi

New User


Joined: 03 Apr 2014
Posts: 6
Location: india

PostPosted: Fri Apr 04, 2014 12:09 pm    Post subject:
Reply with quote

Thanks a lot it works and sorted my requirement. One more thing i can see if we the total and count matches then the outfile will contain the record detailng the count for each types.

If they don't match then we are abending. Is it possible to write a message in the outfile if the total's doesn't match?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Apr 04, 2014 12:44 pm    Post subject: Reply to: Validating File using DFSORT/ICETOOL
Reply with quote

Look up NULLOFL in the manual, and then re-assess your question.

You should understand everything abou tthe solution before asking questions. You're going to paste it as your solution, so you'd better know how to answer questions on it, which means you understanding it all first.

Could you repeat the condition on another OUTFIL and get a message there? Have a go. You have some sample code, the manuals, examples in the manuals, examples you can search for on the internet.
Back to top
View user's profile Send private message
Varun Sethi

New User


Joined: 03 Apr 2014
Posts: 6
Location: india

PostPosted: Fri Apr 04, 2014 3:07 pm    Post subject:
Reply with quote

Please accept my sincere apologies. I did understood the solution completely and gave a try to NULLOFL but it was not working for me. Anyways will try the other options.

Thanks Skolusu for all the help.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


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

PostPosted: Fri Apr 04, 2014 4:01 pm    Post subject:
Reply with quote

Quote:
but it was not working for me


Could you explain why?

Could you paste the error that you had got if any?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Apr 04, 2014 11:18 pm    Post subject:
Reply with quote

Varun Sethi wrote:
Thanks a lot it works and sorted my requirement. One more thing i can see if we the total and count matches then the outfile will contain the record detailng the count for each types.

If they don't match then we are abending. Is it possible to write a message in the outfile if the total's doesn't match?


Varun Sethi,

I specifically asked you what needs to be done if the totals don't match and your response was

Varun Sethi wrote:
if the count and the total doesn't match then i would like to set the return code or abend.


And now you want it differently? When you have abend, what would you do with the message? If you need help then please do us a favor to spell out the complete requirement rather than bits and pieces or you should be capable enough to make the changes for your self.


Varun Sethi wrote:
I did understood the solution completely and gave a try to NULLOFL but it was not working for me. Anyways will try the other options.


This kind of response isn't going to help you anyway. When you say something that doesn't work you need to provide us what you did and explain why it doesn't work as none of us can read your mind nor look over your shoulder.
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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