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

selection of record depending on the sequence no


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

New User


Joined: 02 Jun 2006
Posts: 12

PostPosted: Mon Jun 12, 2006 6:40 pm
Reply with quote

File1

Code:

PAN number
4546383420005566
4546383420005764
4546383420005889


File2

Code:

Rec       PAN number
Type
N         4546383420005566
N         4546383420005764
C         4546383420005889
N         4546383420005889
C         4546383420005764
C         4546383420005566


My file1 contains some PAN numbers and File2 contains Record Type and PAN number.
Now I want to have records in output file from File1, if PAN no from File1 is present in File2
and the record type sequence is N and C in File2. If the sequence is C- N then we don't want to have
dhat record in output file.

Required output file:

Code:

4546383420005566
4546383420005764


Please note that Pan no 4546383420005889 is not present in output file because in File2 record type
sequence of this PAN number is CN and not NC.

Can I achieve this using DFSORT ?
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: Mon Jun 12, 2006 8:40 pm
Reply with quote

Are there always exactly 2 records with each PAN number, one of which is type N and the other is type C? (that is, only C-N or N-C is possible for a given PAN number)?

If not, please give details of the other possible variations (e.g. PAN number with just N record; PAN number with three records; PAN number with record type other than N or C), and show a good example of the records in each input file for the various situations, and the expected output records.

What is the RECFM and LRECL of input file1? What is the RECFM and LRECL of input file2?

What is the position, length and format of the PAN number in input file2?
Back to top
View user's profile Send private message
spkulkarni

New User


Joined: 02 Jun 2006
Posts: 12

PostPosted: Tue Jun 13, 2006 9:52 am
Reply with quote

There will always be 2 records for each pan in File1, one will be N and other will be C record.

Both the files are FB
LRECL of file 1 = 16
LRECL of File2 = 17

position of pan in File1 = (1,16) and its alphanumeric
position of pan in File 2= (2,16) and its alphanumeric
here 2 is offset and 16 is length
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: Tue Jun 13, 2006 8:58 pm
Reply with quote

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

Code:

//S1    EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN1  DD DSN=...  input file1 (FB/16)
//IN2  DD DSN=...  input file2 (FB/17)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/16)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,16,CH) -
  WITHEACH WITH(18,1) WITH(19,1) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,16,C'1',2X)
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(2,16,X,1,1,1,1)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(17,3,CH,EQ,C'1NC'),
    OUTREC=(1,16)
/*
Back to top
View user's profile Send private message
spkulkarni

New User


Joined: 02 Jun 2006
Posts: 12

PostPosted: Tue Jun 13, 2006 9:16 pm
Reply with quote

Hello Frank,

Thanks for the reply and code.

But it seems that BUILD dosen't work with the configuration / version of DFSORT I am currently having.
Its giving me error as:
CTL1CNTL :
OUTREC BUILD=(1,16,C'1',2X)
*
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Will it be possible for us to do it without ( or using something else) BUILD ?
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: Tue Jun 13, 2006 11:16 pm
Reply with quote

Quote:
But it seems that BUILD dosen't work with the configuration / version of DFSORT I am currently having.


Actually, the WER messages indicate you have Syncsort, not DFSORT. The job works fine with DFSORT.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't normally answer questions on Syncsort. However, in this case, I'm feeling charitable, so I've changed the job to not require BUILD.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top