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

want to remove last 8 lines from the o/p file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subarna roy

New User


Joined: 07 Dec 2007
Posts: 16
Location: mumbai

PostPosted: Tue Feb 19, 2008 6:34 pm
Reply with quote

Hi

I am using an input file where there are transaction details , total number of transaction and then some default( containing genaral information) lines like materials copy rigt etc.
this default line consists of total 8 line.

The number of transactions and transaction detail can vary.
but those 8 lines are constant.
Now dont want those 8 lines in the output file.

Please help
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 19, 2008 6:43 pm
Reply with quote

What product / utility were you considering using to achieve this ?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 6:45 pm
Reply with quote

Try sorting in reverse order (inrec add a seqnum) and sort back with an 8 record skip.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Feb 19, 2008 7:19 pm
Reply with quote

subarna roy wrote:
then some default( containing genaral information) lines like materials copy rigt etc.
this default line consists of total 8 line.

Now dont want those 8 lines in the output file.

Please help


Why do you want to remove the "copy rigt" information.
Back to top
View user's profile Send private message
subarna roy

New User


Joined: 07 Dec 2007
Posts: 16
Location: mumbai

PostPosted: Tue Feb 19, 2008 7:26 pm
Reply with quote

Hi
As per business need we need to remove those genaral information.

Sorting in reverse order and then skip the 8 records is not acceptable by the client.

regards
Subarna
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 7:33 pm
Reply with quote

subarna roy wrote:
Sorting in reverse order and then skip the 8 records is not acceptable by the client.
Then, unless you can identify the 8 lines for a sort omit, you will have to do it programmatically.....
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Feb 19, 2008 10:22 pm
Reply with quote

A tiny REXX:

Code:
ADDRESS TSO "EXECIO * DISKR input (STEM IN. FINIS"
ADDRESS TSO "EXCEIO "IN.0 - 8" DISKW output (STEM IN. FINIS"


O.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 19, 2008 10:22 pm
Reply with quote

Hello,

If the data contains some copyright notification, i suggest your management needs to sign something that this is being intentioinally removed.

Whoever holds the copyright may well find this unacceptable - indeed maybe even actionable.

Quote:
As per business need we need to remove those genaral information.
Falsely presenting this by removing the copyright is not a business need. . .
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Feb 20, 2008 7:53 am
Reply with quote

try a search for all terms on:-
Code:
TRAILER1=('  OPTION STOPAFT=',COUNT-



Gerry
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Feb 20, 2008 4:34 pm
Reply with quote

Hi subarna roy,

Please check with the following code for your requirement.
The following code has the logic suggested by gcicchet.
Code:
// EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//INFILE DD DSN=INFILE,DISP=SHR
//TOOLIN DD *
 COUNT FROM(INFILE) LOWER(8) RC4
/*
// IF (RC = 0) THEN
// EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//INFILE DD DSN=INFILE,DISP=SHR
/*
//CTL2CNTL DD DSN=&&T,DISP=(,DELETE)
//OUTFILE DD SYSOUT=*
//TOOLIN DD *
 COPY FROM(INFILE) TO(CTL2CNTL) USING(CTL1)
 COPY FROM(INFILE) TO(OUTFILE) USING(CTL2)
/*
//CTL1CNTL DD *
 OUTFIL REMOVECC,NODETAIL,
 TRAILER1=(C' OPTION STOPAFT=',COUNT-8=(M11))
/*
// ELSE
// IF (RC = 4) THEN
// EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD *
INPUT FILE HAS LESS THAN OR EQUALS TO 8 RECORDS
/*
//SYSUT2 DD SYSOUT=*
// ENDIF
// ENDIF

Thanks,
Shankar
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: Tue Aug 19, 2008 3:58 am
Reply with quote

You can do this kind of thing quite easily using the new SUBSET operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008):

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DISP=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) INPUT REMOVE LAST(8)
/*


For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Aug 19, 2008 8:02 am
Reply with quote

You can use FILEAID to get this done easily, if you have it in your shop and ofcourse if it is acceptable by the client.

Thanks,
Arun
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top