Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue May 26, 2015 10:10 am Post subject:
Magesh_J,
That looks ok, but how are you are limiting the data to last 5 years?. With just the year you are looking at more than 5 years of data. Since you did not have the month you will include the data from the months that are completed in the current year.
For example if the current date is december 31st you would still include the data for 2010 which in reality should only have 1 day data.
Mmmm... the symbols/SYMNAMES aren't costing anything for performance.
If you need(ed) more than the COPY and INCLUDE in the step, the is additional "complexity" (either all the cards generated, or the INCLUDE and then concatenated names, or reading and updating a "skeleton").
Code:
//GENNAME EXEC PGM=SORT
//SYMNAMES DD *
GEN-SYMNAME-VARIABLE-CONTENT,3,2,CH
GEN-SYMNAME-NAME,C'SELECTION-YEAR-MINUS-FIVE,C'''
A-QUOTE,C''''
//SYMNOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=&&SYM,UNIT=SYSDA,DISP=(,PASS),SPACE=(TRK,1)
//SORTIN DD *
CONTENT NOT IMPORTANT, BUT MUST BE AT LEAST ONE RECORD
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY,STOPAFT=1,NULLOUT=RC4
Add the SYMNAMES and SYMNOUT DDs and just use the generated name (whatever you want to call it) in the INCLUDE COND=.
You get a bit of description, you can add (by concatenation) other symbols, for instance to describe the source of the data for the comparison.
The above is fairly general for generating a symbol. The first WHEN=INIT gets the data (JPn, or something like this, for instance) and the second formats the symbol itself. So quite reusable.
Either way will work, but I don't see a reason for "avoiding SYMNAMES" as though it were something which would lead to improvement.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed May 27, 2015 11:28 am Post subject:
William Collins wrote:
Mmmm... the symbols/SYMNAMES aren't costing anything for performance.
Either way will work, but I don't see a reason for "avoiding SYMNAMES" as though it were something which would lead to improvement.
William,
The suggestion of avoiding symnames is purely based on how simple the include cond is. It is not effecting the performance in any way.
I for one am not a big fan of symbols as I like to see my control cards all aligned and easy to read. With symbols everything is squeezed and it is not that easy to read them if you need to fix anything.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum