IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Record count of RECFM=U tape file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Wed Jan 06, 2021 4:51 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Jan 06, 2021 6:07 pm
Reply with quote

www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.icem100/kc00042.htm
Back to top
View user's profile Send private message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Wed Jan 06, 2021 6:20 pm
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1315
Location: Vilnius, Lithuania

PostPosted: Wed Jan 06, 2021 6:33 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Wed Jan 06, 2021 6:40 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2145
Location: USA

PostPosted: Wed Jan 06, 2021 6:47 pm
Reply with quote

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. icon_lol.gif )

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Jan 07, 2021 3:46 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2145
Location: USA

PostPosted: Thu Jan 07, 2021 4:33 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2145
Location: USA

PostPosted: Thu Jan 07, 2021 4:44 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Jan 07, 2021 6:11 am
Reply with quote

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
View user's profile Send private message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Thu Jan 07, 2021 11:27 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1337
Location: Bamberg, Germany

PostPosted: Thu Jan 07, 2021 11:34 am
Reply with quote

@d2: Not all utilities report valid sizes to the tape management system.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Thu Jan 07, 2021 12:22 pm
Reply with quote

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
View user's profile Send private message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Thu Jan 07, 2021 12:36 pm
Reply with quote

@WJ

Here sort is not working as the input recfm is U
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1337
Location: Bamberg, Germany

PostPosted: Thu Jan 07, 2021 12:51 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Thu Jan 07, 2021 1:17 pm
Reply with quote

Have you tried RECFM=F,BLKSIZE=max,LRECL=max as sergeyken suggested?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2145
Location: USA

PostPosted: Thu Jan 07, 2021 9:14 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Jan 07, 2021 9:25 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
Search our Forums:

Back to Top