Page 1 of 2

SORT Variable File

PostPosted: Sun Dec 05, 2010 2:30 am
by Vineet
I have a Variable Length File having LRECL = 550. It's a Delimited File. There is a Date Field. My Requirement is If Date Field is = 01/01/1900 That Record should Not be Included in Out Put File. Problem I'm Facing is that being a Variable Length File Column Position of Date Field is Not Fixed. So how can I get Desire Result? Below is Example.

1234|ABCD|01/01/1900||XYZ| ----> Date Field Starts at Position 11.Record Should get Rjected.
1234567|ABCDEFG|01/01/1900|ABC123|XYZ| ----> Date Field Starts at Position 17.Record Should get Rjected.
98765439|ABXYZ|02/02/2010|XYZ|XYZ123| -----> Record Should get Printed to O/P File.
98765439|ABxyz123|02/02/2010|XYZ|XYZ123| -----> Record Should get Printed to O/P File.
1|AB|01/01/1900|ABC123|XYZ| ------>Date Field Starts at Position 06.Record Should get Rjected.

Start Column Position Of Date Field is Not Fixed. Output File is going to be a Variable Length File having LRECL = 550 Delimited (Same as input File).

Re: SORT Variable File

PostPosted: Sun Dec 05, 2010 3:37 am
by MrSpock
Can't you use a SubString(SS) in either an INCLUDE or OMIT, i.e.:

...
  OPTION COPY
  OUTFIL OMIT=(5,545,SS,EQ,C'|01/01/1900')
...

Re: SORT Variable File

PostPosted: Sun Dec 05, 2010 5:11 pm
by Vineet
Hi Spock,

Can U Be More Clear On This. As I stated its a Variable Length File & Position Of Date Field is Not Fix. In UR SORT Card U Specify OUTFIL OMIT = (5,545,SS,EQ,C'|01/01/1900'), where as length of File is 550. I apprfeciate if U can Provide me the JCL & SORT Card. How To Define Substring in SORT Card.

Thanks
Kind Rgds

Re: SORT Variable File

PostPosted: Sun Dec 05, 2010 8:21 pm
by enrico-sorichetti
all reading Your posts would be appreciate if You could use normal english words instead of SMSish ones
this is a professional forum, not a chat line :D

Re: SORT Variable File

PostPosted: Sun Dec 05, 2010 11:31 pm
by dick scherrer
Hello,

I apprfeciate if U can Provide me the JCL & SORT Card.
Is there some reason you cannot clone existing SORT JCL. . . :?

where as length of File is 550
How To Define Substring in SORT Card.
The "sort card" Mr Spock posted defines the substring. Change the length as needed.

You need to create comprehensive test data and make sure the process works for all cases. Running successfully against a bit of "real" data is not a comprehensive test.

Re: SORT Variable File

PostPosted: Sun Dec 05, 2010 11:41 pm
by Vineet
Hu Dick,

I have Never Use Substring in JCL, for this reason I asked for JCL / SORT Card. Can U Provide me any Sample JCL or Document which Talks about How to use SUBSTRING in SORT. A Query, Whn having Variable File where Position of Field is Not Certain (In My Case Date Field) How to define the Start Position. I Appreciate if U can help me out.

Thanks
Rgds

Re: SORT Variable File

PostPosted: Sun Dec 05, 2010 11:58 pm
by dick scherrer
Hello,

I have Never Use Substring in JCL, for this reason I asked for JCL / SORT Card.
After today, you will have used substring. It is NOT in JCL - it is in the "sort card".

The Syncsort documentation describes substring. If you do not have the documentation, you should contact Syncsort and they can tell you how to download the material.


I Appreciate if U can help me out.
You have been "helped out". . .

Please explain why you have not copied some existing sort jcl and changed it for your use (using the "sort card" provided by Mr Spock to control the process).

Re: SORT Variable File

PostPosted: Mon Dec 06, 2010 12:20 am
by Vineet
Hi Dick,

I Dnt have any JCL ready for This. I was Not Sure wheather its my requirement is possible using SORT. So I just Posted this Requirement. Does this mean in Sort Card we have to Provide Start Position, Total Length,SS & the Criteria. Please Clarify for Substring do we need to Use 'SS'. I appreciate if U can provide me Syntax.

Thanks
Kind Rgds

Re: SORT Variable File

PostPosted: Mon Dec 06, 2010 1:48 am
by dick scherrer
Hello,

You are making this far more difficult/confusing . . .

Can you not find one other sort that is running on your system? Can you not ask someone who also uses your system the name of a job that uses the sort? That is the place to start - with a sort job that already runs succerssfully on your system.

Then, change the job for your input and output datasets - first using test data not a "real" run. Then copy in the sort control provided earlier and modify if needed. Submit the job. . .

Post a reply here showing the success or failure of the job. Post the jcl & control info you use and the informational output generated by the sort.

Re: SORT Variable File

PostPosted: Mon Dec 06, 2010 2:13 am
by Vineet
I am not making anythng difficult/confusing. In My System There is No such SORT Exist, Otherwise I would have taken that JCL & Tested My Requirement, this is the Reason I posted Here.Can U provide me the Syntax Of SORT.

Thanks
Kind Rgds