Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Writing Records in Reverse Order

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Writing Records in Reverse Order
 Login/Join
 
Member
posted
I have a Physical sequential file with 10 records.

I want to copy all these records into another ps fille in the reverse order (last record should be first record in the new file).

IS IT POSSIBLE ? HOW ????


Thanks
Shri
Mainframe FOCUS 7.2.6
WEBFOCUS 5.2
 
Posts: 16 | Registered: May 02, 2006Report This Post
<Special-K>
posted
If this is a one-off for this file only you could do 10 -READs followed by 10 -WRITEs in the reverse order like this:

FILEDEF file1 DISK location1
FILEDEF file2 DISK location2
-RUN

-READ file1 &VAR1.A40
-READ file1 &VAR2.A40
-READ file1 &VAR3.A40
-READ file1 &VAR4.A40
-READ file1 &VAR5.A40
-READ file1 &VAR6.A40
-READ file1 &VAR7.A40
-READ file1 &VAR8.A40
-READ file1 &VAR9.A40
-READ file1 &VAR10.A40
-WRITE file2 &VAR10
-WRITE file2 &VAR9
-WRITE file2 &VAR8
-WRITE file2 &VAR7
-WRITE file2 &VAR6
-WRITE file2 &VAR5
-WRITE file2 &VAR4
-WRITE file2 &VAR3
-WRITE file2 &VAR2
-WRITE file2 &VAR1

If this procedure is to be used many times with an unknown number of records in the file you'll have to try something else
 
Report This Post
Member
posted Hide Post
I have tried your code on Mainframe FOCUS
But I am getting only the first Record only in my Output.

FILEDEF P7
FILEDEF B7
-RUN

-READ P7 &VAR1.A40
-READ P7 &VAR2.A40
-READ P7 &VAR3.A40
-READ P7 &VAR4.A40
-READ P7 &VAR5.A40
-READ P7 &VAR6.A40
-READ P7 &VAR7.A40
-READ P7 &VAR8.A40
-READ P7 &VAR9.A40
-READ P7 &VAR10.A40
-WRITE B7 &VAR10
-WRITE B7 &VAR9
-WRITE B7 &VAR8
-WRITE B7 &VAR7
-WRITE B7 &VAR6
-WRITE B7 &VAR5
-WRITE B7 &VAR4
-WRITE B7 &VAR3
-WRITE B7 &VAR2
-WRITE B7 &VAR1

The location of the file P7 and B7 are given in JCL.

Could you please help me


Thanks
Shri
Mainframe FOCUS 7.2.6
WEBFOCUS 5.2
 
Posts: 16 | Registered: May 02, 2006Report This Post
<Special-K>
posted
It might be the A40 you'll need to change this to the length of the record in your file. Try -TYPEing the values to the screen first as it's only 10 records see what that produces
 
Report This Post
Member
posted Hide Post
FILEDEF P7
UNKNOWN FOCUS COMMAND FILEDEF
BYPASSING TO END OF COMMAND
FILEDEF B7
JAUGAR 130150
ERROR AT OR NEAR LINE 114 IN PROCEDURE TEST FOCEXEC
(FOC295) A VALUE IS MISSING FOR: VAR9

I am getting this error

As my file layout is
FILENAME=P7,SUFFIX=FIX
SEGNAME=MAIN
FIELD=NAME, , A10,A10, $ 001-010
FIELD=ID, , I3,A3, $ 011-013
FIELD=BATCH, , I3,A3, $ 014-017
FIELD=FILLER, , A63,A63, $ 018-080


And also its reading the first record

Thanks
Shri


Thanks
Shri
Mainframe FOCUS 7.2.6
WEBFOCUS 5.2
 
Posts: 16 | Registered: May 02, 2006Report This Post
<Special-K>
posted
Should your VAR9 be &VAR9?
No matter, ignore that and try this

TABLE FILE P7
LIST NAME ID BATCH FILLER
ON TABLE HOLD AS HOLD1
END

TABLE FILE HOLD1
PRINT E02 E03 E04 E05
BY HIGHEST E01 NOPRINT
ON TABLE HOLD AS HOLD2
END

If you then TABLE out HOLD2 it should be in reverse order of the original file
 
Report This Post
Platinum Member
posted Hide Post
Here is another way without using a hold file.
DEFINE FILE P7
CNTR/I9= LAST CNTR +1;
END
TABLE FILE P7
PRINT * BY HIGHEST CNTR NOPRINT
ON TABLE HOLD AS HOLD1 FORMAT INTERNAL
END

Good luck.


FOCUS 7.6 MVS PDF,HTML,EXCEL
 
Posts: 115 | Location: Chicago, IL | Registered: May 28, 2004Report This Post
Member
posted Hide Post
Thanks for all your help

I have tried the logic of ET

It worked


Thanks
Shri
Mainframe FOCUS 7.2.6
WEBFOCUS 5.2
 
Posts: 16 | Registered: May 02, 2006Report This Post
Expert
posted Hide Post
on your result of getting only the first record,
you might want to use the NOCLOSE modifier to your -READ statement to keep the file open and reading successsive records.
-READ MYFILE NOCLOSE &MYVAR.A40




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Without dialog manager:

TABLEF FILE FIRST
LIST [the fields]
ON TABLE HOLD
END
TABLE FILE HOLD
PRINT [the fields]
BY HIGHEST LIST NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS SECOND
END

You may need to use an alternate MFD that describes the source as a single (format A) field.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
<Mabel>
posted
Hi Shrivasta,

Has this issue been resolved?

As always, you may contact Information Builders’ Customer Support Services for assistance at any time. The phone number is 1-800-736-6130, or you may access the online system InfoResponse at http://techsupport.ibi.com. Here is a list of information to be ready when you call: http://techsupport.ibi.com/before_you_call.jsp.

Hope this helps.
 
Report This Post
Member
posted Hide Post
Thanks for your help.

This problem has been resolved


Thanks
Shri
Mainframe FOCUS 7.2.6
WEBFOCUS 5.2
 
Posts: 16 | Registered: May 02, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Writing Records in Reverse Order

Copyright © 1996-2020 Information Builders