Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: want to remove last 8 lines from the o/p file
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: 8593
Location: Back in jolly old England

PostPosted: Tue Feb 19, 2008 6:43 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 6:45 pm    Post subject:
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    Post subject: Re: want to remove last 8 lines from the o/p file
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 7:33 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Feb 19, 2008 10:22 pm    Post subject:
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

Site Director


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

PostPosted: Tue Feb 19, 2008 10:22 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Feb 20, 2008 7:53 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Aug 19, 2008 3:58 am    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Aug 19, 2008 8:02 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us