Page 1 of 2

Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 4:33 pm
by priyasingh
I have two input files each having header date of format YYYY-MM-DD at column 16. i need to compare both fdates and if date from 1st file is greater than the date from second file then a temp PS file will be created. Plz help me on this.
Thanks

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 4:40 pm
by BillyBoyo
What is the relationship to the "temp PS"? Created from the data of one of the files, or something completely external to the process?

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 5:28 pm
by priyasingh
that temp file will be empty only. on based on that temp file i'll trigger a net in the OPC. I just need the JCL code for that comparison.
Thanks

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 5:39 pm
by BillyBoyo
Can you post the ICE201I message from a Sort step, please?

I'm not clear about what you mean about the temporary file. If you define a new dataset in the JCL it will be cataloged (if you tell it) irrespective of what goes on in your program.

You can use JOINKEYS on the first records of each file and then do the date compare. You could arrange to set an RC of non-zero by no record written to an output file for whichever condition you choose. Would that do?

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 5:55 pm
by priyasingh
ok leave the part of temp file, can i have the my JCL like if date from first file is greater than date from second file then the job will ended with RC00 otherwise with RC08

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 6:16 pm
by NicC
JCL can NOT do what yuou want! JCL is for specifying what program you want to run and what datasets that program needs. It has nothing to do with controlling the program itself or specifying what the program is to do. I guess you want DFSort CONTROL cards as you have posted in the DFSort part of the forum. IF you really want JCL then what is required for DFSort is in the DFSort Getting Started manual.

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 6:33 pm
by priyasingh
am really sorry for that. yes i want DFsort control card for it.
Thanks

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 9:49 pm
by priyasingh
plz reply if anybody knows about it

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 9:57 pm
by Akatsukami
Priya-chan, as you purport to know PL/I, would it not be quicker to write the very trivial program needed to do this rather than solicit for sort control cards?

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 9:58 pm
by priyasingh
i need it in JCL only. Plz help. I need it urgently