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

JCL with a file as input in sort


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

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Wed Sep 24, 2008 2:39 pm
Reply with quote

Hi,

I must say that I don't know if it possible, but... let me explain.
I have the following code:

Code:
//SORT1C   EXEC  PGM=SORT,PARM='SIZE=MAX'                           
//SYSOUT   DD  SYSOUT=*                                             
//SORTIN   DD  DSN=ARQTGCHP.TTG00038,DISP=SHR
//SORTOUT  DD  DSN=ARQTGCHP.CHPINVAL,         
//             DISP=(,CATLG,DELETE),                             
//             SPACE=(CYL,(200,20),RLSE)           
//SYSIN    DD  *                                                   
  SORT FIELDS=(8,7,A,1,7,A),FORMAT=BI,EQUALS                       
   INCLUDE COND=(114,1,CH,EQ,C'A',AND,((64,2,CH,NE,C'ES', -         
                 AND,64,2,CH,NE,C'RC',AND,64,2,CH,NE,C'RZ', -       
                 AND,64,2,CH,NE,C'SB'), -                           
                 OR,(115,10,CH,GT,C'2006-01-01')))                 
   OUTREC FIELDS=(1:1,7,8:8,7,15:C'X')                             
//*                                                                 


What I want to do is put the date "2006-01-01" in another DSN and do something like:

Code:
...
                 AND,64,2,CH,NE,C'SB'), -                           
                 OR,(115,10,CH,GT,C'&&DSN&&')))                 
   OUTREC FIELDS=(1:1,7,8:8,7,15:C'X')


The reason is that I will have about 10 separate JCL that will use the same date, although is the user that specifies what date will be. I think it's easier to only change on the new DSN rather that all 10 JCLs.

Is there a similiar solution?

Best regards
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 Sep 24, 2008 9:53 pm
Reply with quote

The easiest way to do this with DFSORT would be to put a record with the date in a data set (let's call it SYMBOL) with RECFM=FB and LRECL=80 like this:

TARG,'2006-01-01'

That would give you a DFSORT symbol in the SYMBOL data set that you could use in your job like this:

Code:

//SORT1C   EXEC  PGM=SORT,PARM='SIZE=MAX'                           
//SYSOUT   DD  SYSOUT=*         
//SYMNAMES DD DSN=SYMBOL,DISP=SHR
...
                 AND,64,2,CH,NE,C'SB'), -                           
                 OR,(115,10,CH,GT,TARG)))                 
   OUTREC FIELDS=(1:1,7,8:8,7,15:C'X')


You could then change '2006-01-01' in SYMBOL to whatever you need.

If you only want to put the date in SYMBOL like this:

2006-01-01

then you could use a separate DFSORT step to create the TARG symbol from that record.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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
Search our Forums:

Back to Top