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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm


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