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
 

 

JCL with a file as input in sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: JCL with a file as input in sort
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 Moderator


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

PostPosted: Wed Sep 24, 2008 9:53 pm    Post subject:
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    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 5 Tue Jan 17, 2017 4:26 pm
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 Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 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


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