Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to move FIELD-A appending to FIELD-B

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Luizsergio

New User


Joined: 05 Jun 2008
Posts: 3
Location: Brazil, Rio de Janeiro

PostPosted: Fri Jun 13, 2008 6:17 pm    Post subject: How to move FIELD-A appending to FIELD-B
Reply with quote

How to move FIELD-A appending to FIELD-B?
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Jun 13, 2008 6:56 pm    Post subject: Reply to: MOVE APPENDING
Reply with quote

Luiz,

Welcome to the forums.

Quote:
How to move FIELD-A appending to FIELD-B?


You will have to provide few more details about your requirement. What is the picture clause and the sample input and output.
Back to top
View user's profile Send private message
Luizsergio

New User


Joined: 05 Jun 2008
Posts: 3
Location: Brazil, Rio de Janeiro

PostPosted: Sat Jun 14, 2008 12:57 am    Post subject: Re: Reply to: MOVE APPENDING
Reply with quote

Thanks for your answer...

I have something like this...

INPUT FILE
INPUT-HEADER PIC X (5).
INPUT-SEQ PIC 9 (1).
INPUT-DETAIL PIC X (2) OCCURS 620 TIMES.
LINKAGE
LINKAGE-HEADER PIC X (5)
LINKAGE-OUTPUT PIC X (32000).

IF DETAIL-HEADER EQUAL LINKAGE-HEADER
MOVE INPUT-DETAIL(IDX) NOT EQUAL SPACES TO LINKAGE-OUTPUT
APPENDING THE INPUT-DETAIL.

EXAMPLE
LINKAGE-HEADER = AAAAA

INPUT-HEADER = AAAAA
INPUT-SEQ = 1
INPUT-DETAIL = 3344552211
INPUT-HEADER = AAAAA
INPUT-SEQ = 2
INPUT-DETAIL = 993344

LINKAGE-OUTPUT = AAAAA13344552211AAAAA2993344
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Jun 14, 2008 1:37 am    Post subject:
Reply with quote

Code:

IF INPUT-DETAIL (IDX) NOT = SPACES
   MOVE SPACES TO LINKAGE-OUTPUT
   MOVE INPUT-DETAIL(IDX) TO LINKAGE-OUTPUT (1 : 2)
   MOVE INPUT-DETAIL (1 : 1240) TO LINKAGE-OUTPUT (3 : 1240)
END-IF.
Back to top
View user's profile Send private message
Luizsergio

New User


Joined: 05 Jun 2008
Posts: 3
Location: Brazil, Rio de Janeiro

PostPosted: Mon Jun 16, 2008 7:27 pm    Post subject:
Reply with quote

Thanks Craq Giegerich
Your solution is great, but I am needing something more effective because it is an online application. Using this logic it is taking so long to return the response.
Again, thank you for your response.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 16, 2008 7:39 pm    Post subject:
Reply with quote

Luizsergio wrote:
Thanks Craq Giegerich
Your solution is great, but I am needing something more effective because it is an online application. Using this logic it is taking so long to return the response.
Again, thank you for your response.


You could leave out the move spaces but that isn't going to make a noticeable difference in response time, I think you need to look else where for inefficiencies.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jun 16, 2008 8:44 pm    Post subject:
Reply with quote

In COBOL when you're talking about appending data you're talking reference modification, which is not a fast process. If your online application is having response time issues with reference modification you may need to rethink the application logic. Tables may (or may not) buy some performance improvement, or perhaps you pass the data to a background task that can complete the reference modification while the transaction continues to handle user interactions. Another possibility would be to throw the data into a TDQ pointing to a sequential file and let a batch job do the appending. If you go the TDQ route, you'll want to close & open it regularly to flush the buffers for the batch job.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Mon Jun 16, 2008 8:54 pm    Post subject:
Reply with quote

Hi !

What about using STRING instruction with the POINTER options.
So you don't need any reference modification.

Regards, UmeySan
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 16, 2008 9:04 pm    Post subject:
Reply with quote

Robert Sample wrote:
In COBOL when you're talking about appending data you're talking reference modification, which is not a fast process. If your online application is having response time issues with reference modification you may need to rethink the application logic. Tables may (or may not) buy some performance improvement, or perhaps you pass the data to a background task that can complete the reference modification while the transaction continues to handle user interactions. Another possibility would be to throw the data into a TDQ pointing to a sequential file and let a batch job do the appending. If you go the TDQ route, you'll want to close & open it regularly to flush the buffers for the batch job.


Since neither of the reference modifications (1 :2) and (3 : 1240) involve any variables they are resolved to moves at compile time. If INPUT-DETAIL does not change between calls that move could be done just once.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 16, 2008 9:15 pm    Post subject:
Reply with quote

Hello,

Quote:
Using this logic it is taking so long to return the response.
The length of time is not due to those few moves.

Your performance problem is elsewhere.

I believe it is not possible to "see" the response time impact of an IF and 3 MOVEs. . . icon_confused.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us