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

JCL to write records satisfying a particular condition


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

New User


Joined: 05 Jan 2010
Posts: 6
Location: chennai

PostPosted: Wed Jan 06, 2010 12:21 am
Reply with quote

I have a file in which sales done for the whole year is present. The sales date is there in the fomat (DDMMYY).

Now I want to create a output file, which has the sales date only after 010909. Can you please suggest me a easy way to do this .

EXAMPLE I/P file :
xxxxxxxxxx yyyyyyyy 010109 zzzzzz...
xxxxxxxxxx yyyyyyyy 010209 zzzzzz...
xxxxxxxxxx yyyyyyyy 010909 zzzzzz...
xxxxxxxxxx yyyyyyyy 011009 zzzzzz...

REquired O/P file :

xxxxxxxxxx yyyyyyyy 010909 zzzzzz...
xxxxxxxxxx yyyyyyyy 011009 zzzzzz...
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 Jan 06, 2010 1:55 am
Reply with quote

You can use a DFSORT job like the following to what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=SORT                                   
//SYSOUT    DD  SYSOUT=*                                 
//SORTIN DD *                                             
xxxxxxxxxx yyyyyyyy 010109 zzzzzz...                     
xxxxxxxxxx yyyyyyyy 010209 zzzzzz...                     
xxxxxxxxxx yyyyyyyy 010909 zzzzzz...                     
xxxxxxxxxx yyyyyyyy 011009 zzzzzz...                     
//SORTOUT DD SYSOUT=*                                     
//SYSIN    DD    *                                       
  OPTION COPY                                             
  INREC OVERLAY=(81:25,2,23,2,21,2)                       
  OUTFIL INCLUDE=(81,6,CH,GE,C'090901'),BUILD=(1,80)     
/*
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Tue Jan 12, 2010 7:29 pm
Reply with quote

What will the record length of output file be?
Back to top
View user's profile Send private message
karthick anandaraman

New User


Joined: 05 Jan 2010
Posts: 6
Location: chennai

PostPosted: Tue Jan 12, 2010 7:33 pm
Reply with quote

it will be same as that of the input file.. I just want to filter the records.
Back to top
View user's profile Send private message
karthick anandaraman

New User


Joined: 05 Jan 2010
Posts: 6
Location: chennai

PostPosted: Tue Jan 12, 2010 7:35 pm
Reply with quote

Thank you Frank.. your JCL worked wonderful for me..
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts Identify and write records containing... SYNCSORT 11
No new posts Filter records where condition is in ... SYNCSORT 6
Search our Forums:


Back to Top