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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
read and write
 Login/Join
 
<lumen>
posted
Hi,

There are 2 sequential files infile and outfile.I want to read infile ,check some conditions(like IF AGE GE 60 THEN.....) and write it into outfile.Could anyone help me please.

Thanks
 
Report This Post
<Steve Cowell>
posted
-SET &INREC = ' ';
-SET &OUTREC = ' ';

-* Allocate files
FILEDEF INFILE DISK infile.dat
FILEDEF OUTFILE DISK outfile.dat
-RUN

-READLOOP
-* Read file contents, in this example I am using a single 25 alpha field
-READ INFILE NOCLOSE &INREC.A25
-* Are we at the end of the file?
-IF &IORETURN NE 0 THEN GOTO END_MAILREAD;
-* Insert you IF condition here and put the results in a variable so that we can write it out
-SET &OUTREC = &INREC;
-WRITE OUTFILE &OUTREC
-GOTO READLOOP

-END_MAILREAD
 
Report This Post
Expert
posted Hide Post
Alternatively, create a master file for your INFILE and then TABLE it, storing the output via SAVE or HOLD etc.
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<lumen>
posted
quote:
Originally posted by Steve Cowell:
[qb] -SET &INREC = ' ';
-SET &OUTREC = ' ';

-* Allocate files
FILEDEF INFILE DISK infile.dat
FILEDEF OUTFILE DISK outfile.dat
-RUN

-READLOOP
-* Read file contents, in this example I am using a single 25 alpha field
-READ INFILE NOCLOSE &INREC.A25
-* Are we at the end of the file?
-IF &IORETURN NE 0 THEN GOTO END_MAILREAD;
-* Insert you IF condition here and put the results in a variable so that we can write it out
-SET &OUTREC = &INREC;
-WRITE OUTFILE &OUTREC
-GOTO READLOOP

-END_MAILREAD [/qb]
Hi steve,

I am using sequential datasets in OS/390.Also is that possible to write the data in a buffer(HOLD AS) to a sequential dataset ?.

Thanks.
Sunil
 
Report This Post
<lumen>
posted
quote:
Originally posted by sunilnair:
[qb]
quote:
Originally posted by Steve Cowell:
[qb] -SET &INREC = ' ';
-SET &OUTREC = ' ';

-* Allocate files
FILEDEF INFILE DISK infile.dat
FILEDEF OUTFILE DISK outfile.dat
-RUN

-READLOOP
-* Read file contents, in this example I am using a single 25 alpha field
-READ INFILE NOCLOSE &INREC.A25
-* Are we at the end of the file?
-IF &IORETURN NE 0 THEN GOTO END_MAILREAD;
-* Insert you IF condition here and put the results in a variable so that we can write it out
-SET &OUTREC = &INREC;
-WRITE OUTFILE &OUTREC
-GOTO READLOOP

-END_MAILREAD [/qb]
Hi steve,

I am using sequential datasets in OS/390.Also is that possible to write the data in a buffer(HOLD AS) to a sequential dataset ?.

Thanks.
Sunil [/qb]
Hi steve,

The same logic is working for datasets also.By the way how can I check end of file.Thank you very much.

Sunil
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders