Darren;
What you want is LikeRec. The code snippets below demonstrate how to use the 6.1 file template/local file/record DS capabilities, the last line is the ReadC operation you want to use.
Define the template, in a copybook in my case:
Fdisplay_t CF E WorkStn Qualified
F Template
F ExtDesc('OTD5568')
F ExtFile('OTD5568')
F SFile(SFITEMLIST)
Use the template in a procedure to define a local file:
Fdisplay LikeFile(display_t)
F Static
F IndDs(displayInd)
F SFile(SFITEMLIST : sflRRN)
F UsrOpn
Define the I/O structure(s). (Define your indicator struct like you always have):
D listCtl...
D DS LikeRec(display_t.scItemList : *ALL)
D listCtlOut...
D DS LikeRec(display_t.scItemList :
D *OUTPUT)
D listSflOut...
D DS LikeRec(display_t.sfItemList :
D *OUTPUT)
D listSflIn...
D DS LikeRec(display_t.sfItemList :
D *INPUT)
ReadC Code:
ReadC display.SFITEMLIST listSflIn;
Duane Christen
--
Duane Christen
Senior Software Engineer
(319) 790-7162
Duane.Christen@xxxxxxxxxx
Visit PAETEC.COM
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of darren@xxxxxxxxx
Sent: Tuesday, January 26, 2010 2:14 PM
To: midrange-RPG RPG message board
Subject: READC and *INPUT datastructure
How do you use READC correctly with a DS?
I've been using data structures more with my RPG I/O commands. I'm a little stumped by READC though. The manual says that the data structure used in a READC must be defined with *INPUT, which means only input capable fields are defined. In many of my subfile programs, the action field is the only input capable field available. So if the user puts a 2 on the second record subfile record, you get a '2' back in the READC, but nothing else.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.