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

Sort & exclude records based on value in control card.


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

New User


Joined: 12 Mar 2007
Posts: 20
Location: USA

PostPosted: Thu Mar 15, 2007 10:33 pm
Reply with quote

Hi.

Can anyone provide info regarding the best techinque to use on the following situation. I have an existing control card which contains data to be used for an INCLUDE/EXCLUDE line on the sort. This control card is created dynamically, so the data changes from run to run. Has anyone encountered the same situation, and what technique worked best to resolve the issue?

Thank you.
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 15, 2007 11:22 pm
Reply with quote

I don't understand what issue it is you're trying to resolve. I might guess that you're looking for a way to easily change the value in the INCLUDE statement from run to run and I'd suggest a DFSORT Symbol for that. But you say the INCLUDE statement is dynamically created, so it appears you already have a way of changing the value. Please explain in more detail what problem you're trying to solve, with examples.
Back to top
View user's profile Send private message
G-Johnson

New User


Joined: 12 Mar 2007
Posts: 20
Location: USA

PostPosted: Thu Mar 15, 2007 11:43 pm
Reply with quote

My control card will look like...

INCLUDE COND=(164,8,CH,LT,C'******')

where ****** is a value stored in another file.

Thank you.
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 15, 2007 11:52 pm
Reply with quote

You can use a DFSORT symbol instead of C'******', e.g.

Code:

  INCLUDE COND=(164,8,CH,EQ,TARGET)


The DFSORT symbol would be:

TARGET,'value'

You can generate the DFSORT Symbol from the value in the file. If you want me to show you how, answer these questions:

What is the RECFM and LRECL of the file with the value? What is the starting postion of the value in that file?
Back to top
View user's profile Send private message
G-Johnson

New User


Joined: 12 Mar 2007
Posts: 20
Location: USA

PostPosted: Fri Mar 16, 2007 12:06 am
Reply with quote

An example would be very helpful. The DCB for the control card record being used is DCB=(LRECL=513,BLKSIZE=0,RECFM=FB) the positions I need to place in the sort card are 66 - 82 (17 characters)

My above example would look like...
INCLUDE COND=(164,8,CH,LT,C'******')
where the ****** characters are the 17 characters from the dynamic record being used in the control card.

Thank you for your help.
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: Fri Mar 16, 2007 1:12 am
Reply with quote

Quote:
My above example would look like...
INCLUDE COND=(164,8,CH,LT,C'******')
where the ****** characters are the 17 characters from the dynamic record being used in the control card.


Huh? Why are you using 164,8 for a character string of 17 characters? Only the first 8 characters will be used. I would think you'd want either (1) 164,17 with a 17-character string or (2) 164,8 with an 8-character string. Which is it?
Back to top
View user's profile Send private message
G-Johnson

New User


Joined: 12 Mar 2007
Posts: 20
Location: USA

PostPosted: Fri Mar 16, 2007 1:38 am
Reply with quote

Sorry...I copied that from the wrong area.

INCLUDE COND=(164,17,CH,LT,C'*****************')

The 17 bytes exist in a control card record. I will need to read that record to get the 17 bytes.
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: Fri Mar 16, 2007 4:37 am
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  control card file (FB/513)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT symbol as:
* TARGET,'text_value'
  INREC BUILD=(C'TARGET,''',66,17,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN...  output file
//SYSIN    DD    *
  OPTION COPY
* Use DFSORT symbol in INCLUDE statement
  INCLUDE COND=(164,17,CH,LT,TARGET)
/*
Back to top
View user's profile Send private message
G-Johnson

New User


Joined: 12 Mar 2007
Posts: 20
Location: USA

PostPosted: Fri Mar 16, 2007 6:59 pm
Reply with quote

I replaced BUILD with FIELDS and it worked. Thank you very much for your assistance.
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: Fri Mar 16, 2007 9:15 pm
Reply with quote

If you can't use BUILD, then either you aren't using DFSORT, or you don't have the Dec, 2004 DFSORT PTF so your site is way behind on DFSORT service. If you are using DFSORT, ask your System Programmer to install z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). That will get you all of the available DFSORT function.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top