Page 2 of 2

Re: How to move values from one file to another file

PostPosted: Fri Apr 08, 2011 3:10 pm
by BillyBoyo
Thanks enrico. I've downloaded it.

However, this topic started as an interview question on Cobol. I'm not sure the interviewer would be so happy with "I'd use Galili-Giancarlo and write it in C" as an anwer. Maybe they would. Shows initiative, broader knowledge not only of languages, but research and more complex algorithms than mostly you'd find in Cobol. If I was the interviewer, I'd certainly ask, after the candidates more exact explanation, "yes, but I'd like to know how you'd approach it in Cobol".

What I have tried to show is how I used to do substrings in Cobol. I first did this before UNSTRING was available, and before LE (and without access to C/C++, PL/X'0001' or FORTRAN) and without wanting to do it in Assembler (although thinking about it it would not be as bad as all that).

Would I use the technique today? Yes, to produce a result. Would I also find time to look for a more "modern" alternative? I'd like the think so.

I like the idea, to an extent, of calling Rexx from Cobol. Is this really possible (doesn't seem to mention it in LE)? To another extent, I also don't like the idea, if it is possible.

Re: How to move values from one file to another file

PostPosted: Fri Apr 08, 2011 4:01 pm
by Akatsukami
BillyBoyo wrote:I like the idea, to an extent, of calling Rexx from Cobol. Is this really possible (doesn't seem to mention it in LE)?

Absolutely; establish the environment (if necessary) using IKJTSOEV, then invoke the exec via IKJEFTSR (a/k/a) TSOLNK.

Re: How to move values from one file to another file

PostPosted: Fri Apr 08, 2011 8:35 pm
by BillyBoyo
Thanks, I'll look up the documentation.

Re: How to move values from one file to another file

PostPosted: Mon Apr 11, 2011 1:19 pm
by Lavanya Arun
Thanks Billy :) its quiet useful and clear :)

Re: How to move values from one file to another file

PostPosted: Mon Apr 11, 2011 3:44 pm
by BillyBoyo
No problem. If you don't mind, I'd like a copy of the final program. Might save me a load of typing some time. If you can PM me with the attachment when your program is ready, I'd be grateful.

Re: How to move values from one file to another file

PostPosted: Tue Apr 12, 2011 3:13 am
by BillyBoyo
Mmm... did you try compiling it yet? It looks like, if you are using Release 4, you might just get the odd error or two. Sorry about that. Release 2 is apparently '74 Cobol standard. Release 4 is '85 Cobol standard. If you can believe it, no-one asked me when they were discussing the '85 standard :o, and the flexibility of OCCURS DEPENDING ON was severely curtailed.

You can still use the Release 2 by specifying the compiler option CMPR2, but this particular technique will now have limited (no) use to you in the future. I am saddened. Also a little concerned about what various poor souls will have had to do in various places I worked when they migrated to Release 4. I bet they didn't see that coming! They even screwed up another trick I used to use, but that is another story.

I picked up this looking through the manuals. I assume it is correct.

Perhaps time to take my own advice and look up "reference modification" :-)