Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comparing fields to a value in another file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Comparing fields to a value in another file.
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    Post subject:
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 Moderator


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

PostPosted: Wed Mar 30, 2011 10:19 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 31, 2011 1:24 pm    Post subject:
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 Moderator


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

PostPosted: Thu Mar 31, 2011 11:11 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us