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
 

 

How to Sort a flat file using condition from an input file!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jobin thomas

New User


Joined: 19 Aug 2008
Posts: 15
Location: Bangalore

PostPosted: Mon Oct 06, 2008 2:49 pm    Post subject: How to Sort a flat file using condition from an input file!
Reply with quote

Hi,

Input File to be sorted:
Code:
20080731 XXXXXXXXX
20080825 XXXXXXXXX
20080826 XXXXXXXXX
20080827 XXXXXXXXX
20080828 XXXXXXXXX
20080829 XXXXXXXXX
20080830 XXXXXXXXX
20080831 XXXXXXXXX
20080901 XXXXXXXXX
....


Condition file:
Code:
XXXXX 20080830 XXXXXXXXXX


I would pick the month (i.e., 08 ) from the condition file and sort the input file. ie., the sorted output should have only details for August.

Sorted Output:
Code:
20080825 XXXXXXXXX
20080826 XXXXXXXXX
20080827 XXXXXXXXX
20080828 XXXXXXXXX
20080829 XXXXXXXXX
20080830 XXXXXXXXX
20080831 XXXXXXXXX


I am not sure, but is there any way we can pass the MM value from condition file as INCLUDE condition to sort the input file???
Or there is some other way to do it?
Back to top
View user's profile Send private message

jobin thomas

New User


Joined: 19 Aug 2008
Posts: 15
Location: Bangalore

PostPosted: Mon Oct 06, 2008 3:10 pm    Post subject:
Reply with quote

The value '08' (august month) is to come from the condition file. And using this value I would sort my input file.
Code:

INCLUDE COND=(5,2,CH,EQ,'08')


The value '08' has to come from another file (named condition file)....

Is there any way to do that using JCL Utilities.
Last option will be to write an easytrieve or COBOL.
Back to top
View user's profile Send private message
jobin thomas

New User


Joined: 19 Aug 2008
Posts: 15
Location: Bangalore

PostPosted: Mon Oct 06, 2008 5:14 pm    Post subject:
Reply with quote

LRECL and date position are actually different.

Input File length : 150 [Date field for MM at position 30]
Condition File length: 150 [Date field for MM at position 30 and it has got just one record]
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: Mon Oct 06, 2008 10:14 pm    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=...  condition file (FB/150)
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD *
  OPTION COPY
* Create DFSORT Symbol for month as:
* TMON,'mm'
  INREC BUILD=(C'TMON,''',30,2,C'''',80:X)
/*
//S2       EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN   DD DSN=...  input file (FB/150)
//SORTOUT  DD DSN=...  output file (FB/150)
//SYSIN    DD *
* Use TMON symbol in INCLUDE statement.
  INCLUDE COND=(30,2,CH,EQ,TMON)
  SORT FIELDS=(26,8,CH,A)
/*
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 Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm


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