Reference Modification in Easytrieve

Ask/Clarify the questions on EASYTRIEVE

Moderators: DikDude, Moderator Group

Post Reply
bhaskar.naidu
Member
Posts: 16
Joined: Mon Jul 06, 2009 5:25 pm

Reference Modification in Easytrieve

Post by bhaskar.naidu » Tue Feb 23, 2010 3:11 am

Hi,
I have got a requirement in which I need to do a reference modification for a record in my output file.

For ex:
Variable1 - PIC X(30).

If Condn-1
Move 123 to Variable1(1:5)
Move 876 to Variable1(7:3)
...
...
...
End-if

Can I do this in an easytrieve program?
If so, please let me know the syntax.

Thanks,
Bhaskar

User avatar
Chanti
Member
Posts: 32
Joined: Thu Nov 27, 2008 4:31 pm

Post by Chanti » Tue Feb 23, 2010 10:30 pm

Hi Bhaskar,

I think, direct reference modification is not possible in Easytrieve as in Cobol.

You need to follow the approach mentioned below
Declare some working storage variable

ws-variable1 W 30 A
ws-v1 ws-variable1 5 A
ws-v2 ws-variable1 +7 3 A (+7 indicates ws-v2 starts at 7 position and is of 3 bytes)
..
.. .
...

then use ws-v1,ws-v2 according to your requirement, like
ws-v1 = 123

and then

You can move the ws-variable to variable. as

variable1 = ws-variable1

Please correct me if iam wrong.

Thanks,
Chanti.

bhaskar.naidu
Member
Posts: 16
Joined: Mon Jul 06, 2009 5:25 pm

Post by bhaskar.naidu » Wed Feb 24, 2010 5:24 am

Thanks a lot for your help.

Regards,
Bhaskar

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others