Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sort & exclude records based on value in control card.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort & exclude records based on value in control card.
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 Moderator


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

PostPosted: Thu Mar 15, 2007 11:22 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Mar 15, 2007 11:52 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Mar 16, 2007 1:12 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Mar 16, 2007 4:37 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Mar 16, 2007 9:15 pm    Post subject:
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us