View previous topic :: View next topic
|
Author |
Message |
nayanishpatil
New User
Joined: 16 Aug 2007 Posts: 14 Location: INDIA
|
|
|
|
Here is a small situation and I would like to know which one will work better and what's the advantage of using it that way.
A file is having only one field say :
REQUEST-ID PIC S9(09) COMP.
So, while declaring in the FILE SECTION, which of the ways below is preferred:
FD REQUEST-ID-FILE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD.
a)
01 REQUEST-ID-REC.
05 REQUEST-ID PIC S9(09) COMP.
OR
b)
01 05 REQUEST-ID PIC S9(09) COMP. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Nayanish,
Both has same effect. |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Hi,
Group variable is always alphanumeric. If you have some operations to do related to alphanumeric, first one is preferable. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
01 05 REQUEST-ID PIC S9(09) COMP. |
Assuming the extra "05" is a typo, either would work....
Quote: |
Group variable is always alphanumeric. |
Yes, but 01 levels can be elementary items too.... |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
I would say the situation posted does not make any practical sence. I've never seen a file declared for just one variable. If there are many variables then we have to use group variables.
Rest I agree with all others that if only one variable is there then there is no advantage as such in either way.. |
|
Back to top |
|
|
nayanishpatil
New User
Joined: 16 Aug 2007 Posts: 14 Location: INDIA
|
|
|
|
I think that the post requires opinions on which option would work better and advantages of the same.
There is not need to comment on what sense it makes to any individual for that matter. And for your kind information, this situation has been used in one of the programs which we are using for the client and had caused a samll variation in output.
So, it's better to address the query rather than other comments.
_____________________ |
|
Back to top |
|
|
kgumraj2
New User
Joined: 01 Aug 2007 Posts: 42 Location: Hyderabad
|
|
|
|
nayanishpatil,
Quote: |
There is not need to comment on what sense it makes to any individual for that matter. And for your kind information, this situation has been used in one of the programs which we are using for the client and had caused a samll variation in output. |
I absoultly aggree with you.
Regarding query,
When I ran it was giving the compiler error.
and second condition will not work, go with first.
Code: |
01
IGYDS1089-S "01" was invalid. Scanning was resumed at the next area
level-number, or the start of the next clause.
|
|
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
nayanishpatil wrote: |
I think that the post requires opinions on which option would work better and advantages of the same.
There is not need to comment on what sense it makes to any individual for that matter. And for your kind information, this situation has been used in one of the programs which we are using for the client and had caused a samll variation in output.
So, it's better to address the query rather than other comments.
_____________________ |
Did I say anything wrong so that you became angry?
I did not say that it doesn't make any sence but any 'Practical or Business' sence. If it makes sense to your business then I don't have any problem. And I did address your query..
Also i would like to know about 'small variation' caused in o/p in more details..
Kumarj2,
Did you remove 05 after 01 which OP has posted wrongly? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
agkshirsagar wrote: |
Also i would like to know about 'small variation' caused in o/p in more details.. |
I also would lke to know..... |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
CICS Guy wrote: |
agkshirsagar wrote: |
Also i would like to know about 'small variation' caused in o/p in more details.. |
I also would lke to know..... |
I doubt we will get that..
maybe OP is busy typing even more ferocious response..
I still don't get what must have offended him, I got 2 votes against me here.. |
|
Back to top |
|
|
nayanishpatil
New User
Joined: 16 Aug 2007 Posts: 14 Location: INDIA
|
|
|
|
It's not about being angry nor I am angry.
I have just brought out to the fore that in case of any queries, such comments are not required. You just address the query and avoid any such comments.
Let me elaborate the "small variation in output".
Assumption:1)The input file is having 16 records.
2)The program is having an SQL query which updates record
matching to the record from the input file.
3) 01 REQUEST-ID PIC S9(09) COMP. is used to declare.
When a JCL prepared for the pgm is run, it finds all the 16 records and even goes fine inside the query. But once all the records are read and the file approaches it's end, it reads a non-existing 17th records and while going in the updation query, the same is not present in the table and hence abends.
But when the same pgm with a group level declaration is used works fine. |
|
Back to top |
|
|
kgumraj2
New User
Joined: 01 Aug 2007 Posts: 42 Location: Hyderabad
|
|
|
|
Quote: |
Kumarj2,
Did you remove 05 after 01 which OP has posted wrongly? |
I havent,
Please check
Code: |
01
IGYDS1089-S "01" was invalid. Scanning was resumed at the next area
level-number, or the start of the next clause.
10 INFILE-RECORD PIC X(3119). |
|
|
Back to top |
|
|
kgumraj2
New User
Joined: 01 Aug 2007 Posts: 42 Location: Hyderabad
|
|
|
|
Sorry to not mention,
This is in the FD level only;
Thanks |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
it reads a non-existing 17th records |
may be the problem is something different .. Would you like to post your logic which checks 'EOF' condition for file and read loop?
kumarj,
Code: |
a)
01 REQUEST-ID-REC.
05 REQUEST-ID PIC S9(09) COMP.
OR
b)
01 REQUEST-ID PIC S9(09) COMP. |
both should compile correctly, please recheck what you have coded.. |
|
Back to top |
|
|
nayanishpatil
New User
Joined: 16 Aug 2007 Posts: 14 Location: INDIA
|
|
|
|
It's not about being angry nor I am angry.
I have just brought out to the fore that in case of any queries, such comments are not required. You just address the query and avoid any such comments.
Let me elaborate the "small variation in output".
Assumption:1)The input file is having 16 records.
2)The program is having an SQL query which updates record
matching to the record from the input file.
3) 01 REQUEST-ID PIC S9(09) COMP. is used to declare.
When a JCL prepared for the pgm is run, it finds all the 16 records and even goes fine inside the query. But once all the records are read and the file approaches it's end, it reads a non-existing 17th records and while going in the updation query, the same is not present in the table and hence abends.
But when the same pgm with a group level declaration is used works fine.
And in both the cases there are no compilation errors. Its an error free code. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Sounds more like a programming bug to me..... |
|
Back to top |
|
|
|