Page 1 of 2

creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 10:50 am
by rakesh086
Hi,

I have my layout like

01 cust-record x(100) A
03 cust-name x(19) A
03 cust-addr x(30) A

Now i want to change this layout as

cust-record w 100 A
cust-name cust-record 1 19 A
cust-addr cust-record 20 50 A

i tried with JCL and RExx but i am not able to insert Cust-record in this conversion. Please help me from this. is there any JCL or REXX program which makes it possible.

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 12:35 pm
by BillyBoyo
Sorry, you'll have to be more clear about what you want to do. Are you converting data, or having trouble with the definition, or what?

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 1:43 pm
by NicC
And whatever it is JCL will not do it - it is not a programming language.

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 2:42 pm
by rakesh086
Hi Billy/NicC,

I am going to use my cobol record layout in easytrive.

and for that i need to convert layout in easytrive.
As i know in easytrive when we are going to define a key syntax is.
cust-Key w 100 A
cust-name cust-Key 1 19 A
cust-addr cust-Key 20 50 A

and in cobol layout is
01 cust-Key x(100) A
03 cust-name x(19) A
03 cust-addr x(30) A
--------
i am using REXX code to convert this cobol layout but the output is
cust-Key w 100 A
cust-name 1 19 A
cust-addr 20 50 A

not like this(which i want)
cust-Key w 100 A
cust-name cust-Key 1 19 A
cust-addr cust-Key 20 50 A

i think we can do it by rexx or cobol also. but not getting how.

hope now you get my point.

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 3:08 pm
by BillyBoyo
You Cobol definitions are not valid. You show a "group" 01-level with a PICture. That'll get the compiler complaining. I don't know why/how your 30-byte field turns into 50 bytes, and I have no idea why you want it to.

CA provide (actually it's been around even before CA owned the product) a program to convert Cobol layouts to Easytrieve. I've not used it myself, so I don't know if it gives you the layout you want (which I think is the right way to go).

I suspect errors in your rexx, but it might help if you start off with valid Cobol.

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 3:26 pm
by rakesh086
extremlly sorry . thats all what u point out, my typo mistakes.

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 3:32 pm
by BillyBoyo
How would I know they are typos?

The best thing to do to post things here is to copy/paste from your mainframe screen. Then you don't get the typos (although at times I suppose pastos might be introduced).

If you can do that and explain what problem you are having, we can start to get somewhere. If you are generating the Easytrieve from rexx, are you asking how you should define fields to satisfy your requirement, or are you getting the "wrong" field definitions out of your rexx? In the latter case, it'll be a code problem in your rexx.

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 3:58 pm
by rakesh086
Hi Billy,

My cobol layout code

01  FILE-RECORD.                   
    03  FILE-KEY.                   
        05  FILE-ACCT.         
            07  FILE-ORG    PIC 999.
            07  FILE-ACCT   PIC X(19).


when i am converting through Rexx. i am getting

FILE-ORG                                1    3    N
FILE-ACCT                                 4    19    A


my expected output:-
FILE-RECORD                                          W       11562 A
FILE-KEY                          FILE-RECORD                22    A 
FILE-ORG                          FILE-RECORD                3     N
FILE-ACCT                         FILE-RECORD        +3      19    A

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 4:15 pm
by NicC
I would say that your Rexx program is wrong - either it is parsing your input incorrectly or you are building the output incorrectly but without seeing the code who can tell? Suggest you post your code in the rexx section of the forum - with code tags.

Re: creation of a easytrive key field

PostPosted: Thu Feb 02, 2012 4:39 pm
by BillyBoyo
Well done with the Code tags. You can use the Preview button to see how it looks before submitting, for those last adjustments.

You do still have a problem with a duplication in the Cobol layout.

Is the rexx code yours? Or whose?

The output from the rexx is valid Easytrieve definitions for a file, but the rexx has only chosen to do it for "elementary" items, ie ignoring group items.

You want to include group items, and you also want to be able to use the layout in the "working storage", ie with it not having to be subordinate to a file. This is also possible, but requires the rexx to be changed.