How to move values from one file to another file



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

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

Postby BillyBoyo » Fri Apr 08, 2011 3:10 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby Akatsukami » Fri Apr 08, 2011 4:01 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

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

Postby BillyBoyo » Fri Apr 08, 2011 8:35 pm

Thanks, I'll look up the documentation.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby Lavanya Arun » Mon Apr 11, 2011 1:19 pm

Thanks Billy :) its quiet useful and clear :)
Lavanya Arun
 
Posts: 3
Joined: Thu Apr 07, 2011 6:28 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Mon Apr 11, 2011 3:44 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby BillyBoyo » Tue Apr 12, 2011 3:13 am

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" :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post