Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
obtain matching data from one file based on search file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: obtain matching data from one file based on search file
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 Moderator


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

PostPosted: Fri Nov 13, 2009 3:05 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Nov 13, 2009 3:46 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Nov 13, 2009 4:41 am    Post subject:
Reply with quote

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

http://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    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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us