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
 
how to give dynamic values in sort condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Wed Oct 17, 2007 12:44 pm    Post subject: how to give dynamic values in sort condition
Reply with quote

Hi all,

I have a scenario where i need to give date field dynamically to the sort control statement.

i have input file with following records which have 1st 10 bytes as date.
now i have to pick up the records which have current date and write them in to one output file and the records which do not match the current date should be written to some other output file

Code:


12/10/2007.......
13/10/2007.....
15/10/2007.....
16/10/2007.....
17/10/2007.....
18/10/2007....
19/10/2007....


now i want to take the records which have current date to one output file
and remaining to some other file.

for example if current date is 17/10/2007 then my first output file should have only 17/10/2007 and remaining records should written to second output file


i want this to be done using jcl sort.

thanks in advance!!
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 Oct 17, 2007 9:15 pm    Post subject:
Reply with quote

You can use a DFSORT job like this to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SYMNAMES DD *                                                 
* Use system symbols to create a DFSORT symbol for:
* CURDATE,C'dd/mm/yyyy'
CURDATE,S'&DAY./&MON./&YR4'                                     
//SYMNOUT DD SYSOUT=*                                           
//SORTIN DD *                                                   
12/10/2007.......                                               
13/10/2007.....                                                 
15/10/2007.....                                                 
16/10/2007.....                                                 
17/10/2007.....                                                 
18/10/2007....                                                   
19/10/2007....                                                   
//OUT1 DD SYSOUT=*                                               
//OUT2 DD SYSOUT=*                                               
//SYSIN    DD    *                                               
  OPTION COPY     
* Use the CURDATE symbol in INCLUDE.                                               
  OUTFIL FNAMES=OUT1,INCLUDE=(1,10,CH,EQ,CURDATE)               
  OUTFIL FNAMES=OUT2,SAVE                                       
/*


For complete information on DFSORT's System Symbol String Constants function, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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