Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
delete contents of file when no records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
anand.dale

New User


Joined: 29 Jun 2007
Posts: 2
Location: INDIA

PostPosted: Wed Jul 16, 2008 6:30 pm    Post subject: delete contents of file when no records
Reply with quote

I have one file/report with following format:
first 3 lines are for information then records are printed from fourth line:

line 1: Cycle date:mm/dd/yyyy report id:ABC
line 2: name of report
line 3: empid emp name emp dept
line 4: record1 abc test
and so on...

my requirement is if there are no records in file i.e only line 1,2 and 3 are present the same file should be emptied or first three lines to be removed.
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: Wed Jul 16, 2008 6:32 pm    Post subject:
Reply with quote

ICEGENER with the dataset defined to SYSUT2 and use SYSUT1 DD DUMMY
Back to top
View user's profile Send private message
anand.dale

New User


Joined: 29 Jun 2007
Posts: 2
Location: INDIA

PostPosted: Wed Jul 16, 2008 7:35 pm    Post subject: Reply to: delete contents of file when no records
Reply with quote

but how will I check whether fourth record is there or not........if there is no fourth record i can do that
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: Wed Jul 16, 2008 7:41 pm    Post subject:
Reply with quote

Look at the IDCAMS PRINT command using the COUNT parameter and it will become clear grasshopper.
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Thu Jul 17, 2008 12:00 pm    Post subject: Reply to: delete contents of file when no records
Reply with quote

PRINT IFILE (DISK1) COUNT(4) shoul be fine

Not tested
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: Thu Jul 17, 2008 12:06 pm    Post subject: Re: Reply to: delete contents of file when no records
Reply with quote

Prasanthhere wrote:
PRINT IFILE (DISK1) COUNT(4) shoul be fine
Not tested


Yes, but don't forget to add the rather important following information ......

If there are 4 or more records in the file the return code will be zero, if not, the return code will be nonzero
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
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us