2 digit state code (ex: TX,AR,NV etc..) /* Called as SCODE
3 digit company code (ex: 010,060,070..etc) /* Called as CCODE
3 digit Line code (ex: 088,032,059..etc) /* Called as LCODE
9 digit policy number (ex: 936173500,...etc) /* Called as PNUM
2 digit Record type (ex: 01,03,04,21...etc) note : every policy is a group or records starts with record type 01 only
3 digit Trans type (Ex: BNB,BRN,BEN) /* TTYPE
//Sysin
*Scode CCode Lcode TTYPE PCount /* Note : PCOUNT represents number policies in the respective output file
TX 010 088 BNB 1 /* out of 2 policies in input only 1 policy has to be copied respective output since pcount 1
TX 060 032 BNB 2 /* out of 3 policies in input only 2 policy has to be copied respective output since pcount 2
AR 070 032 BEN 1 /* out of 2 policies in input only 1 policy has to be copied respective output since pcount 1
NV 070 060 BRN 2 /* out of 1 policies in input only 1 policy has to be copied respective output
--
--
/*
output
"userid".scode+ccode+Lcode.timestamp.TTYPE /* since here there are 4 input entires and hence 4 output files
Note : out of 3 policies in input file(100000001, 986171125,100000002) i need the first 2 matching policy records i.e 100000001, 986171125) since
PCount is 2
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
nkothako,
You still haven't answered all my questions. I think I am just too slow to follow your requirements as I still don't know what you are trying to accomplish.
1. How many Input files do you have? 1 or 2 ?
2. You keep mentioning the PCOUNT, Is that from a different file?
3. Is the number of output files also variable? Like do you want to create 100's of files for each unique key combo?
My input file will contains policy details. Each policy is a set of records and Number of records in each policy is not consitant but starting rec will be identified by RTYPE with 01.
> Since we have 3 cases and hence need to create 3 output file where all the output file should have same attributes of input file.
> PCount is nothing but the number of matched policies need to be there in output file. ex : case1 the o/p 1 should have only 1 policy and o/p file2 should have 2 policies
Case1
The o/p file1 should conatin only 1 policy since PCOUNT is 1 and when scode is "TX" and TTYPE is "BNB" is matched in input file.
so (policy1, policy2 & policy4 matched but output file should contain only one policy since pcount is 1 and so all the corresponding policy records
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
nkothako,
Please read all the questions once again and answer them.
You keep mentioning SYSIN and some instream data . DFSORT can only process DFSORT CONTROL Cards via SYSIN. I have no idea of what you mean by passing the data via SYSIN.
You mention the RECFM as VB , do you want the output also to be VB?
Yes
Quote:
What is the LRECL of the input and output files?
The file attributes of input and output should be the same and LRECL=6004
Quote:
How many Input files do you have? 1 or 2 ? Explain the rules for getting from input to output.
Its 2 input file. One is data file and consider its I/p file1 and another one I mentioned in sysin as I/P file2. So please treat sysin as another input dataset. My input data file will contains policy details. Each policy is a set of records and number of records in each policy is not consitant but starting rec will be identified by RTYPE with 01.
Quote:
Explain how PCOUNT is determined.
PCount is nothing but the number of matched policies need to be there in output file.
ex : case1 the o/p 1 should have only 1 policy and o/p file2 should have 2 policies
Quote:
What is the position and format of the fields scode+ccode+Lcode.timestamp.TTYPE ?
This is the naming convention of output dataset "userid."scode""ccode""Lcode".timestamp.TTYPE
Quote:
Is the number of output files also variable? Like do you want to create 100's of files for each unique key combo?
Also, what if the input has several thousand policies? Do you intend to create a separate output file for every policy?
No. We will create the number of output files based on no of I/P file2 entries... In this case it contains only 3 records. In generally I/P file2 will not contains more than 8 entries per day. But the PCount will be huge
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
nkothako,
The following DFSORT JCL will give you the desired results. Since you did not give me the positions of the fields involved , I had assumed them as follows
Scode at position 5 (inclusive of RDW)
Ccode at position 7 (inclusive of RDW)
Lcode at position 10 (inclusive of RDW)
PNUM at position 13 (inclusive of RDW)
RTYPE at position 22 (inclusive of RDW)
TTYPE at position 24 (inclusive of RDW)
for example
the records looks like this
Code:
RDW|5
TX01008893617350001BNB
A brief explanation of the job.
The STEP0100 step takes in your pull file(sysin as you used) data records and creates include cards for OUTFIL files and create a temp file called C1. Since you said the max number of records in pull file is 8 , I used STOPAFT=8.
The STEP0200 step generates the sequencing of policy numbers using inrec/outrec. We also concatenate the file created from step0100 to split the records into various files.