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

obtain matching data from one file based on search file


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

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Fri Nov 13, 2009 2:50 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Nov 13, 2009 3:05 am
Reply with quote

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
View user's profile Send private message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Fri Nov 13, 2009 3:35 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Nov 13, 2009 3:46 am
Reply with quote

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
View user's profile Send private message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Fri Nov 13, 2009 4:28 am
Reply with quote

Thanks frank. that worked like a gem.
and i got the meaning of SYMNAMES by looking into the job log.
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: Fri Nov 13, 2009 4:41 am
Reply with quote

Good. For complete details on SYMNAMES and DFSORT Symbols, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA40/7.0?DT=20090527161936
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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Store the data for fixed length COBOL Programming 1
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top