Helo.
First of all, I sorry if this question has been answered. I have seen most answer but i could not found it.
I need to do two JCL's
FIRST
I need a JCL that count number of records of a file. I need count the numbers of recors that have 'S' in more positions. I would like the output file had: "Number of records that have 'S' at position 15 is 124", "Number of records that have 'S' at position 20 is 262",... The record may have several (the records have many 'S' at different colums.
Only for you help: The key is position 15-25 and it's not duplicates. I think that is not important. My input file has 479 position (>= 15.000.000 records).
The position that I want count 'S' is: 36,46,47,65,66,84,102,120,138,156,174,175,176,188,200,218,219,231,243,255,267,
279,291,303,321,322,323,324,325,326,348,349,350
I have the next jcl but i would changed.
//STEP032 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=&&,DISP=SHR
//TOOLIN DD *
COUNT FROM(IN1) USING(CTL1)
COUNT FROM(IN1) USING(CTL2)
...
/*
//CTL1CNTL DD *
INCLUDE COND=(36,1,CH,EQ,C'S')
//CTL2CNTL DD *
INCLUDE COND=(46,1,CH,EQ,C'S')
...
In my example I hace repeat label CNTL 32 or more times. Can I have only label CNTL with clausule 'IFTHEN' por example? Can I have write he header "Number of records that have 'S' at position xx is xxxx"? (xx = "position 36, 46) (xxxx = total records with 'S')
SECOND
I have a file at 71 position and I need count a number of records of a file. My record's has:
AAAA;X;CVT002;2011-09-13
AAAA;X;CVT001;2011-09-13
AAAA;X;CVT002;2011-09-20
AAAA;X;CVT001;2011-09-20
AAAA;X;CVT002;2011-09-27
AAAA;X;CVT001;2011-09-27
AAAA;X;CVT002;2011-10-04
AAAA;X;CVT001;2011-10-04
AAAA;X;CVT002;2011-10-11
AAAA;X;CVT001;2011-10-11
(AAAA;X is the same)
(CVT001;2011-09-13 - CVT002;2011-09-13 Has 2 records always. One with CVT001; two with CVT002 and the same date)
I want count number of records of a file (I don't need to know numbers of AAAA repeat or numbers of date repeat). This file haven't fixed number of records. The file can be 8 records, 10 records, xxx records. For this I want obtain an output file only with the last 8 records (most current date is the last records; the old date is the first)
In my example, my output file has:
AAAA;X;CVT002;2011-09-20
AAAA;X;CVT001;2011-09-20
AAAA;X;CVT002;2011-09-27
AAAA;X;CVT001;2011-09-27
AAAA;X;CVT002;2011-10-04
AAAA;X;CVT001;2011-10-04
AAAA;X;CVT002;2011-10-11
AAAA;X;CVT001;2011-10-11
(the first 2 records "2011-09-13" I don't need). As I can have xx records, I need count the records automatically and I obtain a file with only 8 last records always
- count records
- If count > 8
write the last 8 records
- else
write all records (because i have not 8 records and i need work with this records)
- end if
Thank you very much
Pulcinella