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
 

 

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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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