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

Process file based on values stored in control card...


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

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Wed Nov 23, 2011 10:08 pm
Reply with quote

Hello there.
I need to know if it's possible to process file based on values stored in second file.

Let's say control card file (80 bytes) has this MAX value (POS 1:4):
Code:
****** ***************************
=COLS> ----+----1----+----2----+--
000001 5000                       
****** ***************************


Main file to be processed has - key is POS 1:4
Code:
****** *****************************
=COLS> ----+----1----+----2----+----
000001 1111                         
000002 2222                         
000003 3333                         
000004 4444                         
000005 5555                         
000006 6666                         
000007 7777                         
000008 8888                         
000009 9999                         
****** ****************************


My output file should contain records where keys are greater than what's in control card:
Code:
****** ****************************
=COLS> ----+----1----+----2----+---
000001 5555                       
000002 6666                       
000003 7777                       
000004 8888                       
000005 9999                       
****** ****************************


Thank you.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Nov 23, 2011 10:27 pm
Reply with quote

If you have a look at this one it does the second part of your task,

For the control file value, you could have a step which generates a SYMNAME with the value from the control file and then use the SYMNAME in the subsequent step.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Nov 23, 2011 11:40 pm
Reply with quote

rmd3003,
It can be done in multiple ways. What is the LRECL for the second file or what you called "Main file"?

Thanks,
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Thu Nov 24, 2011 12:09 am
Reply with quote

sqlcode1 wrote:
rmd3003,
It can be done in multiple ways. What is the LRECL for the second file or what you called "Main file"?

Thanks,


Control file (FILE1) is 80 byes long FB and has only one record - like a control card.
Second file (FILE2) is the file I want to process (504 bytes VB). It's huge - around 150 million records.
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: Thu Nov 24, 2011 12:23 am
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  control file (FB/80)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
  OPTION COPY
  INREC BUILD=(C'TARG,',1,4,80:X)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file (VB/504)
//SORTOUT DD DSN=...  output file (VB/504)
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(5,4,ZD,GT,TARG)
/*
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Thu Nov 24, 2011 12:34 am
Reply with quote

Frank, thank you very much.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top