View previous topic :: View next topic
|
Author |
Message |
r arunmoezhi
New User
Joined: 26 Jun 2009 Posts: 32 Location: Chennai
|
|
|
|
i have a input file which has say 1000 records. (LRECL = 174)
each record has a flag of length 46 with starting position as 129.
i have another file 'SEARCH FILE' which has only one record with LRECL as 46.
This record contains a particular flag of length 46.
Now my output file (LRECL same as the input file) should have only the matching records for that particular flag present in SEARCH FILE |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file2 (FB/46)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'TARG,''',1,46,C'''',80:X)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file1 (FB/174)
//SORTOUT DD DSN=... output file (FB/174)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(129,46,CH,EQ,TARG)
/*
|
|
|
Back to top |
|
|
r arunmoezhi
New User
Joined: 26 Jun 2009 Posts: 32 Location: Chennai
|
|
|
|
frank please let me know if my understanding is correct:
the step S1, copies the single record from file2(FB/46) into a temp file &&S1 after formatting it with 'TARG'
one doubt is teh file S1 is never used again.
DOes SYMNAMES have any predefined meaning.
how can i specify the output file name as SORTIN. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Oops. I messed up the JCL when I copied and pasted it.
I've fixed it in my post above. It should make sense now. |
|
Back to top |
|
|
r arunmoezhi
New User
Joined: 26 Jun 2009 Posts: 32 Location: Chennai
|
|
|
|
Thanks frank. that worked like a gem.
and i got the meaning of SYMNAMES by looking into the job log. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|