View previous topic :: View next topic
|
Author |
Message |
rmd3003
New User
Joined: 03 Jul 2006 Posts: 55
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
|
rmd3003
New User
Joined: 03 Jul 2006 Posts: 55
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
rmd3003
New User
Joined: 03 Jul 2006 Posts: 55
|
|
|
|
Frank, thank you very much. |
|
Back to top |
|
|
|