IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comparing fields to a value in another file.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Yvonne1980

New User


Joined: 31 Aug 2010
Posts: 20
Location: Edinburgh

PostPosted: Wed Mar 30, 2011 3:58 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 30, 2011 4:51 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 30, 2011 10:19 pm
Reply with quote

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
View user's profile Send private message
Yvonne1980

New User


Joined: 31 Aug 2010
Posts: 20
Location: Edinburgh

PostPosted: Thu Mar 31, 2011 1:01 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Mar 31, 2011 1:24 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 31, 2011 11:11 pm
Reply with quote

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
View user's profile Send private message
Yvonne1980

New User


Joined: 31 Aug 2010
Posts: 20
Location: Edinburgh

PostPosted: Fri Apr 01, 2011 12:48 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top