Skip to main content

 DATE3-731 in SORT SYSIN not working as expected. It resolves as C'currentdate'-731 and hence, extracting only current record. I want to extract record what was before 2 years. Any idea how can I do that? In Mainframe, it works correctly.


#JCL
#EnterpriseServer

 DATE3-731 in SORT SYSIN not working as expected. It resolves as C'currentdate'-731 and hence, extracting only current record. I want to extract record what was before 2 years. Any idea how can I do that? In Mainframe, it works correctly.


#JCL
#EnterpriseServer

Hi Fazal,

Which sort utility are you using, see docs link: https://www.microfocus.com/documentation/enterprise-developer/ed90/ED-VS2022/BKFHFHSORT.html ,  do other utilities give a different/expected result?

I do not see an example being shared, but with that in mind I recommend you to raise a support case and including a simplified jcl job/data file example that support team colleagues can test with to recreate the behaviour, that will help speed up the investigation and ensure we test like for like.


Hi Fazal,

Which sort utility are you using, see docs link: https://www.microfocus.com/documentation/enterprise-developer/ed90/ED-VS2022/BKFHFHSORT.html ,  do other utilities give a different/expected result?

I do not see an example being shared, but with that in mind I recommend you to raise a support case and including a simplified jcl job/data file example that support team colleagues can test with to recreate the behaviour, that will help speed up the investigation and ensure we test like for like.

I am not able to create support ticket even though I created the account to login and to create a case. However, here is the example JCL. 

//STEP020A EXEC PGM=SORT
//SORTIN DD *
20043171303668
20043350826498
20221350826498
20222421662738
20223361662738
20223561648018
20223620823858
20233640825308
20241640925398
20242421425838
/*
//SORTOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,7,CH,GE,&DATE3-731)
/*

So, SORTOUT should so only show last 2 years of data during everyday execution. Date is in 'YYYYDDD' format for 1st 7 characters. DATE3 always takes current day and minus 731 is to minus 731 days from current day to get approx 2 years back dated date.  Any assistance from this channel will be helpful. If this is not possible, then, what is the alternative. but I would like to use any sort utility (DFSORT, ICEMAN or ICETOOL) instead of writing a program.


I am not able to create support ticket even though I created the account to login and to create a case. However, here is the example JCL. 

//STEP020A EXEC PGM=SORT
//SORTIN DD *
20043171303668
20043350826498
20221350826498
20222421662738
20223361662738
20223561648018
20223620823858
20233640825308
20241640925398
20242421425838
/*
//SORTOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,7,CH,GE,&DATE3-731)
/*

So, SORTOUT should so only show last 2 years of data during everyday execution. Date is in 'YYYYDDD' format for 1st 7 characters. DATE3 always takes current day and minus 731 is to minus 731 days from current day to get approx 2 years back dated date.  Any assistance from this channel will be helpful. If this is not possible, then, what is the alternative. but I would like to use any sort utility (DFSORT, ICEMAN or ICETOOL) instead of writing a program.

Hi,

Is there a message when you try to create a support ticket, if yes can you share that to help my understanding of why  you are not able to do so.

In the meantime I can continue to assist.
Your example job uses SORT, in the ES region what is the ALIAS set to for that? You can see / change this in the ESCWA UI > JES > ALIAS table, e.g. is it MFJSORT ? You can consider to change the sort program being used by the region and see if that changes the behaviour.


Hi,

Is there a message when you try to create a support ticket, if yes can you share that to help my understanding of why  you are not able to do so.

In the meantime I can continue to assist.
Your example job uses SORT, in the ES region what is the ALIAS set to for that? You can see / change this in the ESCWA UI > JES > ALIAS table, e.g. is it MFJSORT ? You can consider to change the sort program being used by the region and see if that changes the behaviour.

Its FDSSORT. I think if I change to any other sort, it may impact other JCLs which we already fixed as it was behaving differently thru FDSSORT. Any other way?  

As far as login error, here is what I am getting. Sorry, you do not have permission to access resources in the Micro Focus Support Portal. More details


Its FDSSORT. I think if I change to any other sort, it may impact other JCLs which we already fixed as it was behaving differently thru FDSSORT. Any other way?  

As far as login error, here is what I am getting. Sorry, you do not have permission to access resources in the Micro Focus Support Portal. More details

As a test can you change from FDSORT to MFJSORT, check the results. You can revert the change after the test. Or create a new test region and test there then you do not affect other JCLs.


Its FDSSORT. I think if I change to any other sort, it may impact other JCLs which we already fixed as it was behaving differently thru FDSSORT. Any other way?  

As far as login error, here is what I am getting. Sorry, you do not have permission to access resources in the Micro Focus Support Portal. More details

For the support case issue, does your company have an administrator for the support portal that can help you with access, or can colleagues raise cases? If not then let me know and I'll see about asking the relevant support team internally to help with the access issue.


As a test can you change from FDSORT to MFJSORT, check the results. You can revert the change after the test. Or create a new test region and test there then you do not affect other JCLs.

I did that and its working. So, I made a new ALIAS which points to MFJSORT. Thanks.