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

ICETOOL for editing a field of a record in the file


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

New User


Joined: 09 Mar 2007
Posts: 17
Location: kerala

PostPosted: Thu Apr 26, 2007 10:07 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Apr 26, 2007 8:53 pm
Reply with quote

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
View user's profile Send private message
prabe

New User


Joined: 09 Mar 2007
Posts: 17
Location: kerala

PostPosted: Mon Apr 30, 2007 3:10 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Apr 30, 2007 3:18 pm
Reply with quote

Quote:
please reply immediately


for what You request proof of payment is required :-)
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 3:57 pm
Reply with quote

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
View user's profile Send private message
prabe

New User


Joined: 09 Mar 2007
Posts: 17
Location: kerala

PostPosted: Mon Apr 30, 2007 4:12 pm
Reply with quote

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
View user's profile Send private message
prabe

New User


Joined: 09 Mar 2007
Posts: 17
Location: kerala

PostPosted: Mon Apr 30, 2007 4:42 pm
Reply with quote

//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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 4:44 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 4:46 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Apr 30, 2007 8:28 pm
Reply with quote

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
View user's profile Send private message
prabe

New User


Joined: 09 Mar 2007
Posts: 17
Location: kerala

PostPosted: Wed May 02, 2007 2:37 pm
Reply with quote

thanks now it is working

thanks a lot
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top