Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on using copybook library

Status
Not open for further replies.

happyallday

Technical User
Oct 1, 2007
11
CA
Sorry I have never used cobol before.

Now I am giving a file name and a copybook library from our IS department, now I want to use copybook to convert the file to something can be understood.

Can you let me know how to use it please?

Thanks!!
 
The copy library should be something that's in your JCL. That makes what you were given available to a program.

A copy library is just a piece of code that can be inserted into a COBOL program.

To get something out of the file, you shouldn't need too much COBOL knowledge (hopefully).

What is your native language and platform and maybe we can help from there?
 
Thank you so much Glenn9999!

I have experiences in Java/PHP/VB.Net/SQL, and not too much on linux.

Thanks again!
 
Okay, so does this file reside on a PC or on a mainframe? Do you have access to the copy library now? (like you could pull it up on your PC or have it printed out?)
 
That file is in mainframe, I was told the filename
ZHHBF.BFFSAM.HBF1418D(0)

but I can only retrieve through TSO when use file name ZHHBF.BFFSAM.HBF1418D, and it is 380M.

So I guess I didn't do it right

I was also told the copybook library is called HSTLB.PRD.COPY(HBF1418D)

Appreciate all your help !
 
Okay, presuming they're not wanting you to go out and learn their mainframe and learn COBOL (your questions indicate you are not versed in either):

1) the file name is what is called a GDG (generational data set) and the (0) part represents the latest generation.

2) If you can find someone there who is versed with the mainframe enough to access both files for you and then download them to your workstation PC (the next step since you only use PC based languages), that would perhaps be best, since I have no idea of what that process would be where you are at. I presume you would need this, since you list predominantly pc based (not mainframe) languages and would need the files on your PC. Or am I mistaken?

3) There is an EBCDIC to ASCII conversion that is required. If you were to download the file without doing this first, it would mangle the data. This would require someone who is versed on the mainframe side to change the file around so you can read it on the PC side.

To borrow a searched post from WMK on this site (16 Mar 05 1:28):
1) All data should be USAGE DISPLAY (no COMP-3, COMP, BINARY, or PACKED-DECIMAL)

2) All numeric data should be defined with the SIGN IS SEPARATE clause

3) The output file should be defined (in the COBOL program) with the CODE-SET clause specifying STANDARD-1 (ASCII)

4) The JCL for the tape output file should include the
DCB=(OPTCD=Q) feature.

Someone there who is knowledgable in the mainframe should be able to understand all this if they don't know already how to get the file to your PC to work on. Otherwise, I'm not sure what advice I could give, unless some clarification can be sought on what they're expecting out of you (a mainframe program, or a PC program, or just simply some results regarding the file).

Once you have both files available to you in a way that can be used by your software, feel free to post the data definitions and we can help on those.
 
Happy,

Do you have access to TSO, and are you happy to look at the file there?

The answer to this double barreled question will help us to help you.

Regards,

Marc
 
Thanks guys!

I have access to TSO, but I am trying to download the readable to my pc then I can run some reports from there.

Sorry I am really new to mainframe, not sure which command can help me.

And the people from IS department seems too busy or some other reason, they are not so willing to help like you guys.

Really appreciated all advices!
 
Happy,

Go into TSO and then into ISPF (this is often done automatically) and go to option 1 for browse.

Half way down the screen you will see 'Data Set Name . . .' and an input field. Into that input field type 'ZHHBF.BFFSAM.HBF1418D(0)'. Make sure it is in quotes and press enter. This will display the file.

Take your cursor to the top of the screen and press F2. This should split the screen and the panel you are displayed is the primary option menu. Choose option 1 again and in the input field by Data Set Name type 'HSTLB.PRD.COPY(HBF1418D)'. Once again, this should be in quotes.

Hopefully you will now have on one screen the data, and on the other screen the Cobol layout. You can swap between these two screens by pressing F9.

It may be worth while moving the cursor to the middle of the screen and pressing F2 again as you will then be able to see the format and the data in one window.

Have a look at the Cobol layout. It is formatted into level number, field names, and field formats. If you type COLS in the Command line on the data window, you will be able to see the columns that the data resides in.

On the subject of downloading and running reports against the data, if any of the Cobol formats have the word COMP or COMP-3, then you may well have difficulty reading the file properly after downloading. These are binary fields where the data is not easily visible on a PC and you would need software that understood that particular format.

It may be worthwhile asking your IS deptartment if they have a product like File-Aid or similar. With a product like this you can specify the Cobol layout and the file data on one panel, and the software merges them together into a window which shows the field names and the value for each field.

Let us know if you require further help.

Marc
 
Thank you so much Marc!

I followed your steps and I can view the file and copybook layout in one screen. But I do see COMP-3 in the copybook layout.

Also I tried typing "fileaid", but I got this message:

ISPS118L SERVICE NOT INVOKED. A VALID ISPF ENVIRONMENT DOES NOT EXIST.
 
Happy,
That sounds promising to me as it implies that it found fileaid.

Contact your IS department or have a look on the Primary Option menu. Options 1 to 7 are fairly standard, but usually there are extras -D for DB2 or U for Utilities etc. etc. It differs from installation to installation.

I would just go looking down those extras and see if you can find FileAid.

Marc
 
Marc,

I found out how to run fileaid

In "ISPF" screen, enter "6", then it will allow to enter TSO commands, then type "fileaid".

Ok, so the next step would be to figure out how to use fileaid.
 
hi,

if you have a regular pc/mainframe combination, you will probably have a program on your pc that is called RECEIVE.EXE.

To copy the copybook to the PC, you can give the following command on the mainframe behind the command ===> TSOCMD

and on the dos prompt:

RECEIVE HBF1418D.COB 'HSTLB.PRD.COPY(HBF1418D)' ASCII CRLF

It will transfer to your pc. You can paste it to a message here and we can help you with handling the file.

Regards,

Crox

 
Crox's idea is sound, although most mainframe emulators that sit on a PC have inbuilt GUI file transfer software. Also, this would not get around the problem of viewing COMP or COMP-3 fields on the PC.

What I would suggest you do is start FileAid, whereupon it should present you with a FileAid Primary Option menu. Choose option 1 for Browse, and then type in the file name in the relevant field, and the copybook library and copybook name. This should allow you to view the file using the Cobol layout.

Marc
 
Marc,

If we have a copybook, we can help him to create an understandable/downloadable file in cobol......

We can even build a program that does the right conversion on the pc, so he can download in a binary way and convert it.

We can build a cobol program that does the conversion before download on the mainframe, if Happy can compile/link/run a mainframe program........

But because he is more a pc-man, we help him better if we can make the data available on the pc instead of trying to make him a mainframe-man..... :)

Regards,

Crox

 
Good point Crox, I'm just trying to get him to use a proper computer, you know, one that costs at least £6m rather than £600. :)

That said, I'm still not 100% certain what he is going to do with the file once he's got it on PC.

Happy, I know you said that you are trying to download the file and run some reports against it, but could you give us a little more detail? It may be that it's easier to do what you wish using mainframe tools.

Marc
 
We can even build a program that does the right conversion on the pc, so he can download in a binary way and convert it.

Yep, not an impossible thing, either, to go that route (even have written PC programs to handle that, including COMP-3). Don't know which would be easiest, but we can see how it goes.
 
Thanks guys!

I tried file-aid again, but it looks the file is too big to open in file-aid. Do you have any tutoril on using file-aid convert the file?

 
Happy,
I'll try to solve it :)

What's your logon size when you start your TSO session? When you first go to go into the mainframe you possibly get a screen where you can specify size. What's the number on that screen.

If you are having problems with the file in file aid, then try going straight into file aid the minute you go into TSO. Do not pass go, do not collect £200. Sorry, I meant do not go into any other apps. Also, try to browse the file using option 1 rather than edit using option 2. I would have thought that you should be able to get a look at it.

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top