View previous topic :: View next topic
|
Author |
Message |
Yvonne1980
New User
Joined: 31 Aug 2010 Posts: 20 Location: Edinburgh
|
|
|
|
I want to OMIT any records from my file with a date that is less than the current business date, however the current business date is stored in a PDS member.
Does anyone know how to compare the values in a sort file with the value in a PDS member ?
Many thanks. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I would look
(search in this forum- or look at dfsort documentation:
smart tricks, getting started, pgmrs' ref)
SYMNAMES is the search key.
often, 2 sort steps.
one accesses the pds member with the date,
and creates a temp ds that is input to the second step with a
dd ref =SYMNAMES |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yvonne,
Dick described one correct approach. A DFSORT JOINKEYS job might be another way to do it. If you need more specific help with this, you need to provide more information.
Show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files.
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/*
|
|
|
Back to top |
|
|
Yvonne1980
New User
Joined: 31 Aug 2010 Posts: 20 Location: Edinburgh
|
|
|
|
Thanks for the feedback Lads. I was originally playing around with SYMNAMES but I could only manage to get the system date into a useable symbol, I couldn’t get my ‘external’ date from the PDS into a symbol.
I have a PDS: MY.PDS(BUSDAY) which contains the following 10 byte date string: 31/03/2011 (DD/MM/CCYY).
My sort file has an 8 byte date field in the format CCYYMMDD starting in position 372. I want to omit records from the sort file whose dates are less than the date stored in: MY.PDS(BUSDAY).
Frank, I’m using Z/OS DFSORT V1R10
Thanks again. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yvonne, I think Frank really wants to see the line with the message id ICE201I which will tell him the release level and help him give you the correct solution first time around.
Please, in future when someone asks you to do something to provide further information to help YOU, please do exactly what is asked. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yvonne,
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=MY.PDS(BUSDAY),DISP=SHR
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'TDATE,''',7,4,4,2,1,2,C'''',80:X)
/*
//S2 EXEC PGM=SORT
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OMIT COND=(372,8,CH,LT,TDATE)
/*
|
|
|
Back to top |
|
|
Yvonne1980
New User
Joined: 31 Aug 2010 Posts: 20 Location: Edinburgh
|
|
|
|
Brilliant Frank, I was already re-formatting the date in a previous build step, but never thought of building the symbol along with it.
Many thanks. |
|
Back to top |
|
|
|