IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Validating File using DFSORT/ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 03, 2014 6:22 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Thu Apr 03, 2014 8:00 pm
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
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
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: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 03, 2014 9:26 pm
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
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
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
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 04, 2014 12:44 pm
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
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

Global Moderator


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

PostPosted: Fri Apr 04, 2014 4:01 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top