View previous topic :: View next topic
|
Author |
Message |
prabe
New User
Joined: 09 Mar 2007 Posts: 17 Location: kerala
|
|
|
|
I have a file with header detail and trailer records. I want to filter the number detail records using a condition ( such as details records with a filed value 'a') . Then the output file should have the same header ,filtered details and trailer record and also want to update the count of the detail records in the trailer record.( ie there is filed in trailer corresponding to number of details records wrote into output . I want to update that field also |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show an example of the records in your input file and what you expect for the output records. Give the RECFM and LRECL of the input file.
Give the details of the condition for filtering the records. |
|
Back to top |
|
|
prabe
New User
Joined: 09 Mar 2007 Posts: 17 Location: kerala
|
|
|
|
Code: |
Performance report
ram 100
balu 100
siju 200
binu 300
visi 250
srinu 50
prej 100
classXX 7
|
these are my records what I suppose to do is
I want to filter student details with 100 marks
the output should be
Code: |
Performance report
ram 100
balu 100
prej 100
classXX 3
|
please reply immediately |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
please reply immediately |
for what You request proof of payment is required :-) |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
prabe,
You should you given the layout also with examples. Anyways, the sort card which you are looking for is below -
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(7,3,CH,EQ,C'100') * assumption 100 starts @ col 7
OUTFIL HEADER1=(C'PERFOMANCE REPORT'), * Assumed this is a constant
TRAILER1=(C'CLASSXX ',COUNT) * Assumed 'xx' value is constant.
/* |
Input -
Code: |
----+----1----+----2----+---
PERFORMANCE REPORT
RAM 100
BALU 100
SIJU 200
BINU 300
VISI 250
SRINU 050
PREJ 100
CLASSXX 7 |
Output :
Code: |
PERFOMANCE REPORT
RAM 100
BALU 100
PREJ 100
CLASSXX 3 |
|
|
Back to top |
|
|
prabe
New User
Joined: 09 Mar 2007 Posts: 17 Location: kerala
|
|
|
|
sorry, the 'Performance report ' is a header record...' it is not a constant ..
my aim is to write header record as same then start count from detail record then update the count in detail record |
|
Back to top |
|
|
prabe
New User
Joined: 09 Mar 2007 Posts: 17 Location: kerala
|
|
|
|
//S1 EXEC PGM=SORT
//SORTIN DD DSN=JATHI.PS,DISP=SHR
//SORTOUT DD DSN=JATHI1.PS,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(7,3,CH,EQ,C'100')
OUTFIL HEADER1=(C'PERFOMANCE REPORT'),
TRAILER1=(C'CLASSXX ',COUNT)
//SYSOUT DD SYSOUT=*
//*
JATHI.PS contain all the records.
after execcuting the above jcl I got following errors
RECORD TYPE IS F - DATA STARTS IN POSITION 1
SORTOUT CANNOT BE USED FOR A REPORT - RECFM WITHOUT 'A' SPECIFIED, OR VSAM DATA
END OF DFSORT |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
prabe,
Find the required step below -
Code: |
//REPRT EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//INNN DD *
PERFORMANCE REPORT
RAM 100
BALU 100
SIJU 200
BINU 300
VISI 250
SRINU 050
PREJ 100
CLASSXX 7
/*
//OUT1 DD DSN=&SYSUID..&SYSUID..TEST,
// DISP=(MOD,CATLG,CATLG),SPACE=(TRK,2),
// RECFM=FBA,LRECL=80
//TOOLIN DD *
COPY FROM(INNN) TO(OUT1) USING(CRD1)
COPY FROM(INNN) USING(CRD2)
/*
//CRD1CNTL DD *
SORT FIELDS=COPY,STOPAFT=1
/*
//CRD2CNTL DD *
OUTFIL FNAMES=OUT1,
REMOVECC,
STARTREC=1,
INCLUDE=(7,3,CH,EQ,C'100'),
TRAILER1=(C'CLASSXX ',COUNT)
/*
|
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Prabe,
Quote: |
SORTOUT CANNOT BE USED FOR A REPORT - RECFM WITHOUT 'A' SPECIFIED, OR VSAM DATA |
If you use DFSORT trailer or header option, your recfm should be FBA/VBA. If you are using FB use REMOVECC in OUTFIL. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Prabe,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=JATHI.PS,DISP=SHR
//SORTOUT DD DSN=JATHI1.PS,DISP=SHR
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,11,CH,EQ,C'Performance',OR,
7,3,FS,EQ,+100)
OUTFIL REMOVECC,
TRAILER1=('classXX',COUNT-1=(EDIT=(IIT)))
/*
|
|
|
Back to top |
|
|
prabe
New User
Joined: 09 Mar 2007 Posts: 17 Location: kerala
|
|
|
|
thanks now it is working
thanks a lot |
|
Back to top |
|
|
|