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
 
selection of record depending on the sequence no

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: selection of record depending on the sequence no
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 Moderator


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

PostPosted: Mon Jun 12, 2006 8:40 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jun 13, 2006 8:58 pm    Post subject:
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    Post subject: Re: selection of record depending on the sequence no
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 Moderator


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

PostPosted: Tue Jun 13, 2006 11:16 pm    Post subject:
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    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 query to fetch record which has only ... maxsubrat DB2 2 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

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