Hello,
In my procedure step I have found the sysin ststement as below.
PRINT INFILE(IDCAMI) COUNT(3)
Where IDCAMI is the input files logical name. This utility is used for finding out whether the input file is empty or not , by giving the RC=04 if the file is empty.
How this SYSIN statement works.I mean What is the meaninig of COUNT(3) in the above SYSIN statement and how this works in finding out the file is empty or not.
Please Help me out.
Thanks,
Naveen
IDCAMS Utiility
- swd
- Posts: 109
- Joined: Wed Feb 18, 2009 9:18 pm
- Skillset: COBOL, DB2, JCL, REXX, ISPF, IBM Utility Programs, Performance Tuning and Benchmarking
- Referer: Google Search
- Location: UK
Re: IDCAMS Utiility
The COUNT(3) means print the first 3 records of the dataset. It will give a RC=4 if there are 0,1 or 2 records in the file, so to use this to check if the file is empty is not quite correct as if there are 1 or 2 records in the file it will still give RC=4 because there are not enough records in the file, so it gives you a warning.
Specify COUNT(1) will be better to check if the file is empty, as if there are 1 or more records in the file you get RC=0, if there are no records in the file you get RC=4.
Hope this helps
CHeers
Steve
Specify COUNT(1) will be better to check if the file is empty, as if there are 1 or more records in the file you get RC=0, if there are no records in the file you get RC=4.
Hope this helps
CHeers
Steve
-
- Posts: 8
- Joined: Thu Feb 26, 2009 7:33 pm
- Skillset: cobol ,jcl ,IMS,
- Referer: communication
Re: IDCAMS Utiility
Thank you So much ,
Naveen.
Naveen.
-
- Posts: 93
- Joined: Thu Mar 22, 2012 10:02 am
- Skillset: COBOL
CICS
JCL
DB2
VSAM
IMS - Referer: INTERNET
Re: IDCAMS Utiility
Suppose I have a file with headers and Trailers.
I want that if only 1 trailer is present in the entire file No processing should be done.
How can we achieve this using IDCAMS??
I want that if only 1 trailer is present in the entire file No processing should be done.
How can we achieve this using IDCAMS??
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: IDCAMS Utiility
What does this mean? If you do NO processing, then you cannot use a computer AT ALL to do this, so it becomes totally and completely IMPOSSIBLE. Further, to do it -- with IDCAMS or any other program -- will require knowing what identifies a header record, what identifies a trailer record, and what identifies detail records.No processing should be done.
-
- Posts: 93
- Joined: Thu Mar 22, 2012 10:02 am
- Skillset: COBOL
CICS
JCL
DB2
VSAM
IMS - Referer: INTERNET
Re: IDCAMS Utiility
It means the software should not be executed and all other steps bypassed. Just check in first step if only one trailer is there and if yes bypass all other steps.
Header and trailer could be like Header = *****Name, account No, Amount Wealth in header
and Trailer ***** continue on next page >>>
Header and trailer could be like Header = *****Name, account No, Amount Wealth in header
and Trailer ***** continue on next page >>>
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: IDCAMS Utiility
This REQUIRES a software program be executed.Just check in first step if only one trailer is there
What you want to do cannot be done, period.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: IDCAMS Utiility
Hello,
Suggest you consider using your sort product or actually writing some code (i.e. COBOL or Easytrieve are quie common).
IDCAMS has some features, but it is not intended to be a programming language.
Suggest you consider using your sort product or actually writing some code (i.e. COBOL or Easytrieve are quie common).
IDCAMS has some features, but it is not intended to be a programming language.
Hope this helps,
d.sch.
d.sch.
-
- Posts: 93
- Joined: Thu Mar 22, 2012 10:02 am
- Skillset: COBOL
CICS
JCL
DB2
VSAM
IMS - Referer: INTERNET
Re: IDCAMS Utiility
Hmm okkk,
I am thinking if I can consider to include how many records I am expecting per page.
Suppose each page has 1 header + 20 records + 1 trailer= 22.
So if I code INFILE(INDAMI) COUNT (22)
So if now records is greater than 22 then I will get RC = 4 or else 0.
So I proceed for RC = 4 and If RC= 0 bypass all furthur steps.
I am thinking if I can consider to include how many records I am expecting per page.
Suppose each page has 1 header + 20 records + 1 trailer= 22.
So if I code INFILE(INDAMI) COUNT (22)
So if now records is greater than 22 then I will get RC = 4 or else 0.
So I proceed for RC = 4 and If RC= 0 bypass all furthur steps.
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: IDCAMS Utiility
No - if count is greater than 22 you will get a return code of 0. I return code of not zero is returned from utilities when they cannot do what was requested - in your case read 22 records.
I suspect that you have no idea of what you are doing and definitely no idea of the tools available. Why not run through the task with a colleague?
I suspect that you have no idea of what you are doing and definitely no idea of the tools available. Why not run through the task with a colleague?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
Regards
Nic
-
- Similar Topics
- Replies
- Views
- Last post
-
-
PROTECT parm of ALLOCATE cmd of AMS (IDCAMS) failed
by futohomok » Wed Nov 27, 2024 9:53 pm » in VSAM/SMS - 7
- 2664
-
by futohomok
View the latest post
Mon Dec 02, 2024 4:33 pm
-