View previous topic :: View next topic
|
Author |
Message |
JanWouter
New User
Joined: 02 Mar 2007 Posts: 6 Location: Netherlands
|
|
|
|
I'm in need of a way to determine the dsn-name of a file that I'm reading when I'm using concatenated files.
This is to be able to make counts on each file in a concatenation.
Does anybody know of a way how to do this?
Any help would be greatly appreciated. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
The JFCBDSNM field of the JFCB data area will contain the dataset name.
Other methods are:
1. Call REXX that will call LISTDSI with the FILE keyword, and return the dataset name in SYSDSNAME.
2. Invoke the TSO command LISTALC (either from within COBOL or by calling REXX), then parse the output.
O. |
|
Back to top |
|
|
JanWouter
New User
Joined: 02 Mar 2007 Posts: 6 Location: Netherlands
|
|
|
|
I know of the JFCB area, but will this also give me the information about the current file that is being read? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Assuming you know the DDNAME, you can navigate your way to JFCBDSNM through TIOEDDNM. Look for examples (mainly REXX and Assembler) in Google.
O. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When you find some code that will do what you want, i'd suggest that you make it a callable routine that you call pass in the DDNAME and have the routine pass back the current DSN.
If you want a count by dsn, you'll want to call the routine after each read and increment your counters accordingly.
When you have it running, you might also post the routine here |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
In SAS it's easy to get Dataset name using JFCB.
If you are looking for SAS code reply I can post SAS code for you. It's just less than 5 lines of code. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Will SAS allow retrieving the DSN after each record is read? |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
My Bad... If its concatenation then I doubt. |
|
Back to top |
|
|
JanWouter
New User
Joined: 02 Mar 2007 Posts: 6 Location: Netherlands
|
|
|
|
It is concatenation I'm talking about. And the files in the concatenation may vary. So I only know 1 dd-name for several files.
Today I'm going to see what info the jfcb gives me. If I tackle the problem I will post it here. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yes, i believe jfcb is a good way to go. Just remember to check the dsn after each read for the current dsn as you want to count records by dsn.
If so desired, you could also go thru the control blocks and get all of the dsns in the concatenation and so know which files you had as input before reading all of the records. This might be useful if the code needed to know if a given dsn was in the concatenation at the start of the run.
Good luck |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Has anyone gotten this to work? A complete working example of this would be great! Although I do not have a need for it at the present time, I can see uses for it in the future. |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
Back to top |
|
|
|