View previous topic :: View next topic
|
Author |
Message |
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
I have around 50 TAPE files as RECFM=U. I need to extract the record count of each file.
can any one help on this. I tried ICETOOL but its giving me error.
ICE043A 3 INVALID DATA SET ATTRIBUTES: DD01 RECFM - REASON CODE IS 10 |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
Thanks for sharing this detailed information. I got the issue as the input file having RECFM=U. Its failing.
but i need to extract the record count of each file, is there any way to do that |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
d2 wrote: |
but i need to extract the record count of each file, is there any way to do that |
And which PHB came up with this "requirement"? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
RECFM=U means that the data does not have records (as we think of them). It does have blocks but I have no idea of a utility that can count them so you may have to write a program.
But you did not show your control statements or JCL so we do not know how you tried to use DFSort. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
d2 wrote: |
I have around 50 TAPE files as RECFM=U. I need to extract the record count of each file.
can any one help on this. I tried ICETOOL but its giving me error.
ICE043A 3 INVALID DATA SET ATTRIBUTES: DD01 RECFM - REASON CODE IS 10 |
Just “record count” for any DATASET (not file) is absolutely useless unless you have ANY tool available to read actual data from the (physical) records of these datasets with RECFM=U. IMHO, only READ operation issued via BSAM access method can provide such functionality for RECFM=U.
If such tool is available, you can use it also to count the number of records.
Just knowing that “this tape contains 123456789 records” is useless, and almost meaningless. You can provide any random number to your manager in place of 123456789; it will make no difference, and no subsequences. (In case your managers would not trust you, then suggest them to re-check this value by themselves. )
P.S. You cannot cheat any SORT facility, and make it handle physical record with unknown, and non-standard format. This is what RECFM=U stands for. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
d2 wrote: |
I have around 50 TAPE files as RECFM=U. I need to extract the record count of each file.
can any one help on this. I tried ICETOOL but its giving me error.
ICE043A 3 INVALID DATA SET ATTRIBUTES: DD01 RECFM - REASON CODE IS 10 |
DFSORT does not support processing of RECFM=U data sets.
I am not sure why you need this but you could try this steps and see if it works as I don't have a sure answer.
1. Convert RECFM=U to F or V or VB.
ibmmainframes.com/viewtopic.php?t=35722&postdays=0&postorder=asc&start=0
2. Use the converted format and use DFSORT's COUNT operator to get the counts |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
It is impossible to convert RECFM=U to whatever, unless you know exactly the format of data stored in its records.
With RECFM=U there is no such thing as LRECL; only physical records are presented in the dataset, which also are called blocks. BLKSIZE parameter can define the maximum allowed block size (aka record size) for this dataset. Only specific program can deal with those physical blocks; it has to “know” exactly: what to expect within each of blocks?
The suggestion “to convert RECFM=U to F/V/B” is absolutely meaningless. If data structure is unknown, it cannot be done. If data structure is known, there is no need to convert it to another RECFM. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
If the parameter BLKSIZE is defined with RECFM=U, there is a chance that all physical records have the same size. Try to run SORT with
//SORTIN DD ...,RECFM=F,BLKSIZE=max,LRECL=max
If you are lucky it might help to count the records, which in turn is absolutely useless. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
TS doesn’t care about content of the record , under define or just give max lrecl and convert and get count and for that matter if it’s require to find the data structure then let TS do the research and find it out. I don’t see any of what you say will impact this for now. I would avoid assuming anything further until TS first understand and try it to see if works.IDCAMS can also be used to convert it. Just delete the intermediate data sets after count is achieved as its waste of space. |
|
Back to top |
|
|
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
Thank you all for such an beautiful insight on this topic.
on checking few files i found most of the tape files are empty. So is there any way i can check if the files are empty using a single JCL step. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
|
|
|
|
@d2: Not all utilities report valid sizes to the tape management system. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
You can use ICETOOL to check for an empty dataset, like:
Code: |
//C2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//DD1 DD DISP=SHR,DSN=Z.TEST.FB80A
//* COUNT .. EMPTY|NOTEMPTY -> RC 12 IF CONDITION IS MET
//TOOLIN DD *
COUNT FROM(DD1) EMPTY |
I am also pretty sure that there is a blockcount in the tape label, but getting to that might trycky. I can't offhand remember the layout of the label, but there are programs to help with that on cbttape.org and other places. |
|
Back to top |
|
|
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
@WJ
Here sort is not working as the input recfm is U |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
|
|
|
|
It was written before. Use IDCAMS:
Code: |
//METHOD#1 EXEC PGM=IDCAMS <* RC4 ! RC0
//IDD DD DISP=OLD,DSN=<your RECFM=U DSN>
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT IFILE(IDD) COUNT(1)
/* |
|
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Have you tried RECFM=F,BLKSIZE=max,LRECL=max as sergeyken suggested? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
Rohit Umarjikar wrote: |
TS doesn’t care about content of the record , under define or just give max lrecl and convert and get count and for that matter if it’s require to find the data structure then let TS do the research and find it out. I don’t see any of what you say will impact this for now. I would avoid assuming anything further until TS first understand and try it to see if works.IDCAMS can also be used to convert it. Just delete the intermediate data sets after count is achieved as its waste of space. |
Counting “records” with unreachable content is a stupid and useless idea.
It can be done for fun only. No practical result. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
sergeyken wrote: |
Rohit Umarjikar wrote: |
TS doesn’t care about content of the record , under define or just give max lrecl and convert and get count and for that matter if it’s require to find the data structure then let TS do the research and find it out. I don’t see any of what you say will impact this for now. I would avoid assuming anything further until TS first understand and try it to see if works.IDCAMS can also be used to convert it. Just delete the intermediate data sets after count is achieved as its waste of space. |
Counting “records” with unreachable content is a stupid and useless idea.
It can be done for fun only. No practical result. |
May be true but if its a task as a part of ones job then need to do it unless there are no ways to do it but if there are ways then its good to know and give a try even if its useless. So many things happens in IT world which doesn't make sense to me but that is part of the job. I will leave the discussion here and let TS do some testing on provided suggestions. |
|
Back to top |
|
|
|