Need Help on SORT jcl



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need Help on SORT jcl

Postby N J Baruah » Wed Apr 04, 2018 6:07 pm

Hi All,

I need a help from you to sort data from an input file based on the reference date present in it from column 55 to 62. My requirement is to sort out data which has been last referenced within 3 months.

Please note that the reference date is present in the format YY/DD/MM (e.g: 18/03/14 etc).

Can anyone please help me at the earliest ? Thanks in advance.
N J Baruah
 
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help on SORT jcl

Postby Robert Sample » Wed Apr 04, 2018 6:34 pm

Can anyone please help me at the earliest ?
Your first problem is that this is a volunteer forum -- as in, people respond if they have the time, the interest, and the subject knowledge to respond. Asking for urgent help is not likely to get you faster responses -- if the need is so urgent, convince your management to hire a consultant to help you.

Second, this is a HELP forum, not a WRITE-THE-CODE-FOR-YOU forum. Show us what you've coded, the results you got compared to what you expected to get, and we'll have suggestions to improve your code. But not showing us any code is usually a sign you're not going to see any code written for you.

These users thanked the author Robert Sample for the post:
N J Baruah (Wed Apr 04, 2018 6:57 pm)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Need Help on SORT jcl

Postby N J Baruah » Wed Apr 04, 2018 6:53 pm

Thanks Robert for letting me know, will surely take care of it next time. Please find the screenshots attached.
You do not have the required permissions to view the files attached to this post.
N J Baruah
 
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help on SORT jcl

Postby enrico-sorichetti » Wed Apr 04, 2018 7:26 pm

do not post screen shots, they just waste space,

a text cut and paste from the 3270 emulator screen is more than enough.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Need Help on SORT jcl

Postby NicC » Wed Apr 04, 2018 9:46 pm

Nohing to do with JCL but everything to do with Sort - for which there are 2 different sections in the forum depending on the sort product. Moving to DFSort but will move on to Syncsort if that is what you have (look at the messages).
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need Help on SORT jcl

Postby N J Baruah » Thu Apr 05, 2018 9:34 pm

Hi All,

Can anyone please help me with this query ?
Your help will be really appreciated...

Thanks
N J Baruah
 
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help on SORT jcl

Postby enrico-sorichetti » Thu Apr 05, 2018 11:10 pm

soliciting for answers is considered bad netiquette
and it will usually make people ignore the topic

remember ...
we reply on our own time and free of charge

if nobody replies it means that
nobody has an in depth knowledge of the topic
nobody is interested in answering
nobody likes You :mrgreen:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Need Help on SORT jcl

Postby N J Baruah » Mon Apr 09, 2018 6:32 pm

Hi,

I have tried some alternative for it as below using SYMNAMES:

//SYMNAMES DD  *
Cur_Date,S'&YR2./&MON./&DAY'
VALIDATE C'18/02/08'
/*
//SORTIN DD DSN=Input file
//SORTOUT DD DSN=Output file
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(55,8,CH,LE,Cur_Date,AND,55,8,CH,GT,VALIDATE)
/*
 


but instead of hard-coding the date "18/02/08" in the VALIDATE of SYMNAMES, I want to make it dynamic. I mean something like as below to sort out the data which has been last referenced within 3 months

//SYMNAMES DD  *
Cur_Date,S'&YR2./&MON./&DAY'
/*
//SORTIN DD DSN=Input file
//SORTOUT DD DSN=Output file
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(55,8,CH,LE,Cur_Date-90)
/*
 


but unfortunately this is not able to sort out the data which has been referenced within 3 months from the current date.
Can anyone please suggest what needs to be corrected to get the appropriate result as I am struggling with it .
Thanks in advance as this forum really helps us a lot in getting the appropriate results with the help of you guys and I am really in need of your help...
N J Baruah
 
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help on SORT jcl

Postby Robert Sample » Mon Apr 09, 2018 7:57 pm

Why don't you insert the century starting at position 55 (shifting the rest of the record 2 bytes to the right)? Then you have a DATE1 and you can then do a second SORT step to select the records based on the date being in the range you need. You could then strip out the inserted characters so the record length does not change.

Or you could copy the date at 55 to the end of the record, adding the century to make it a 10-byte DATE1, and proceed to use that date in your comparison, again stripping it off the record when you output your data.

You have plenty of ways to proceed, but you seem to have blinders on about how you have to accomplish your goal. And it may not be possible to accomplish the goal the way you want to do it. Until you are willing to look at alternatives, such as making two passes against the data set, you are shackling yourself.

You have posted three topics on this subject in less than a week. You insist the problem is urgent -- despite that this forum does not do urgent -- and yet you haven't been providing useful information. It is getting close to the time that all your topics on this subject will be locked, and any further new topics on the same topic will be locked as soon as possible.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post