Page 1 of 2

SORTING problem with file

PostPosted: Thu Apr 23, 2015 7:50 pm
by kavitasahu
Hi Team,
I have a requirement where in the flat file one of the records is having junk character.

My file structure is like below

1. Customer Number start from column 10 of length 10.
2. Customer Name start from column 20 of length 30.

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
     00002872641774MR AADESH SHRIVAS
     00002713415786MR AJAY KHAN
     00002813516868MR SAMáS ó MIRZA
     00002136168774MR VIJAY SHAH



Problem area here is the Customer name field which is creating problem to the downstream system. As it can be seen that there is junk character in the
Field. So I want to create 2 file here:-

1. First file will have all records excluding problematic record. So it can be passed to downstream system for further processing. So it should contain
below data only:-

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
     00002872641774MR AADESH SHRIVAS
     00002713415786MR AJAY KHAN
     00002136168774MR VIJAY SHAH


2. Second file will have customer number only (which start from column 10 of length 10) which is having invalid character, so I can pass that
customer number back to business informing about the problem. So it should contain below data only:-

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
2813516868



Using below SORT JCL I am able to overlay those junk value with spaces, but that is not my requirement.

OPTION COPY
ALTSEQ CODE=(6B40,7F40,7DF0)
INREC IFTHEN=(WHEN=INIT,OVERLAY=(20:20,30,TRAN=ALTSEQ))


I hope my requirement is clear. Please help me to create SORT jcl for my above requirement and let me know if any other details are required.

Re: SORTING problem with file

PostPosted: Thu Apr 23, 2015 9:36 pm
by prino
And why are accented characters considered "junk"? My sister is called Desirée, and the é is most definitely not a junk character. You don't have any problem sorting the file, you have a much bigger problem with your back-end systems...

Re: SORTING problem with file

PostPosted: Thu Apr 23, 2015 9:53 pm
by Terry Heinze
kavitasahu,
In the future, please use Code tags for readability.

Re: SORTING problem with file

PostPosted: Thu Apr 23, 2015 10:38 pm
by NicC
Topic has been coded and moved to the correct part of the forum (assuming DFSort is the sort product in question).

kavitasahu, you are asking a sort question, not a JCL question. In future please ensure that you post in the correct part of a foum.

Re: SORTING problem with file

PostPosted: Fri Apr 24, 2015 1:02 pm
by kavitasahu
Hi Prino,
I have just given it as an example. There are couple of character in the name field ( like ' and " , business is going to give me the list of invalid characters, So I will add them like CODE=(6B40,7F40,7DF0)). So I just want to have a check for those and wanted to create 2 files as stated above. Hope my requirement is clear. So could you please help me to create sort jcl for the same.

Thanks
Kavita

Re: SORTING problem with file

PostPosted: Fri Apr 24, 2015 1:38 pm
by NicC
The JCL is easy but what you are wanting help with is the sort control cards.
The correct approach is to fix the program producing the incorrect dataset.
I will leave it to the sort wizards to help with the control cards.

Re: SORTING problem with file

PostPosted: Fri Apr 24, 2015 2:18 pm
by BillyBoyo
I'm with Prino. I'm prepared to bet a considerable sum, up to two cents Euro, that the "junk" is far from junk.

Can you run this, and post the the full sysout from the step, so we can see the level of SORT that you have, as it will affect what code you are able to use?
//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
content does not matter
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*

Re: SORTING problem with file

PostPosted: Fri Apr 24, 2015 3:49 pm
by kavitasahu
Thanks Billy for looking into this. I submitted the JCL and getting following in SYSOUT. Please let me know if any other details are required.

RECORD TYPE IS F - DATA STARTS IN POSITION 1
C5-I12416 C6-K90026 C7-K94453 C8-K94453 C9-BASE E5-K80744 E7-I12416
BLOCKSET COPY TECHNIQUE SELECTED
VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 11:07 ON FRI APR 24, 20
OPTION COPY
ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS
TTDVACT1.STEP0010. , INPUT LRECL = 243, BLKSIZE = 27945, TYPE = FB
MAIN STORAGE = (MAX,6291456,6291456)
MAIN STORAGE ABOVE 16MB = (6234096,6234096)
OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,
OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,
OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALO
OPTIONS: RESALL=16384,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,COBEX
OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=N,DSA=0
OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITCK=W,PARM
OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=50 ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSI
OPTIONS: NULLOUT=RC0
OPTIONS: DYNAPCT=10 ,MOWRK=Y
EXCP ACCESS METHOD USED FOR SORTOUT
EXCP ACCESS METHOD USED FOR SORTIN
F4-BASE F5-BASE E8-I12416
OUTPUT LRECL = 243, BLKSIZE = 27945, TYPE = FB

Re: SORTING problem with file

PostPosted: Fri Apr 24, 2015 4:34 pm
by BillyBoyo
OK, thanks. You have 1.12, so you can't use alphanumeric tests available in 2.1.

A simple COPY then, with two OUTFIL statments. One which uses OMIT=(20,20,SS,EQ,X'xx,xx,xx,xx') where each xx is the hexadecimal value you want to avoid. The second OUTFIL has SAVE, so it will get all those not selected in the first OUTFIL, and use BUILD for your reference number list.

Re: SORTING problem with file

PostPosted: Wed Apr 29, 2015 4:37 pm
by kavitasahu
I ran the jcl using following SYSIN card but it is giving below error. However below SYSIN is working fine if I am
searching for any text instead of special character using OMIT=(49,30,SS,EQ,C'ALAN'). It looks its creating prolem to identify
special chracters.

//SYSIN     DD    *                                                 
 OPTION COPY                                                       
 OUTFIL FNAMES=MAINFILE,OMIT=(49,30,SS,EQ,X'6B40,7F40,7DF0,BE40)   
 OUTFIL FNAMES=RESTFILE,SAVE,BUILD=(01:15,10)                       
/*   


Error Message:-

ICE805I 1 JOBNAME: TTDVACT1 , STEPNAME: STEP0010                           
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                 
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                             
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 12:03 ON WE
           OPTION COPY                                                     
           OUTFIL FNAMES=MAINFILE,OMIT=(49,30,SS,EQ,X'6B40,7F40,7DF0,BE40) 
                                                          £                 
ICE113A E COMPARISON FIELD ERROR                                           
           OUTFIL FNAMES=RESTFILE,SAVE,BUILD=(01:15,10)                     
ICE751I 0 C5-I12416 C6-K90026 C7-K94453 C8-K94453 E7-I12416                 
ICE052I 3 END OF DFSORT