View previous topic :: View next topic
|
Author |
Message |
anand.dale
New User
Joined: 29 Jun 2007 Posts: 2 Location: INDIA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
ICEGENER with the dataset defined to SYSUT2 and use SYSUT1 DD DUMMY |
|
Back to top |
|
|
anand.dale
New User
Joined: 29 Jun 2007 Posts: 2 Location: INDIA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Look at the IDCAMS PRINT command using the COUNT parameter and it will become clear grasshopper. |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
PRINT IFILE (DISK1) COUNT(4) shoul be fine
Not tested |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
|