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
 

 

Multiple Validations in a single sort step

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

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Tue Oct 18, 2011 10:39 pm    Post subject: Multiple Validations in a single sort step
Reply with quote

Hello,

I have an input file oF 32 BYTES where 6 fields are comma seperated :

Code:

LAT,123456789,ABCD,XX999,22222,C
LAT,123456789,ABCD,XX999,22222,C
,123456789,ABCD,XX999,22222,C
LAT,111111111,ABCD,XX999,22222,C
LAT,123456789,ABCD,XX999,22222,C
LAT,123456789,ABCD,,22222,C
LAT,123456789,ABCD,XX999,,C


Valid record conditions :-
1. First 3 bytes must be LAT. If as in 3rd record, there is no LAT, then we have to apend LAT to that record and make it valid.
2. second field must always be equal to 123456789. Any other 9 byte will make the record invalid. In above file 4th record is invalid
3. 4th field must always have some values. As in 6th record if there is no value in that field, then that record is invalid.
4.5th field must always have some values. As in 7th record If there is no value in that field, then that record is invalid.
5. 6th field must be always a character 'C'

The records which satisfy all the above conditions must be written to OUTPUT.GOOD.FILE and any records which does not satisfy any one of the above validations must be written to OUTPUT.ERROR.FILE


Can this be achieved using a single sort step ?
If yes, how will my DFSORT code be ?

Thanks for all the help.

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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Oct 18, 2011 11:03 pm    Post subject:
Reply with quote

Quote:
5. 6th field must be always a character 'C'


Show what this type of invalid record could look like. Could it look like this?

LAT,123456789,ABCD,XX999,,,

or like this:

LAT,123456789,ABCD,XX999

or both or some other way?

What is the RECFM of your input file?

Please show what you would expect in the two output files for your input example including the variations for missing C.
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Tue Oct 18, 2011 11:14 pm    Post subject:
Reply with quote

Hi Try this:

Code:


//SYSIN    DD *                                                       
 OPTION COPY                                                         
 INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=3),%02=(ENDBEFR=C',',FIXLEN=9),
              %03=(ENDBEFR=C',',FIXLEN=4),%04=(ENDBEFR=C',',FIXLEN=5),
              %05=(ENDBEFR=C',',FIXLEN=5),%06=(ENDBEFR=C',',FIXLEN=1))
 BUILD=(%01,C',',%02,C',',%03,C',',%04,C',',%05,C',',%06)             
 OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,C'   '),OVERLAY=(C'LAY'),             
        HIT=NEXT),                                                   
  IFTHEN=(WHEN=(5,9,ZD,NE,123456789),OVERLAY=(40:C'1'),HIT=NEXT),     
  IFTHEN=(WHEN=(20,5,CH,EQ,C'     '),OVERLAY=(40:C'1'),HIT=NEXT),     
  IFTHEN=(WHEN=(26,5,CH,EQ,C'     '),OVERLAY=(40:C'1'),HIT=NEXT)     
  OUTFIL FNAMES=T1,OMIT=(40,1,CH,EQ,C'1'),BUILD=(1,32)               
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Tue Oct 18, 2011 11:17 pm    Post subject:
Reply with quote

Oops...I missed the validation for 6th field to be 'C'.
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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 4 Mon Mar 27, 2017 3:59 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm


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