|
Yes - CPYF can do this: FMTOPT(*DROP) In case that the field attributes in TOFILE() are too different you might need FMTOPT(*MAP *DROP). Only if you need to rename fields you need a WRKQRY to create theese fields (or use SEU + CRTPF followed by an CPYF FMTOPT(*NOCHECK). Another funny use of FMTOPT(*DROP) is a fast way to isolate a single field (let's call it 'MYFIEL') from a file: CRTPF QTEMP/MYFIEL RCDLEN(same as the MYFIEL field) CPYF TOFILE(QTEMP/MYFIEL) FMTOPT(*DROP) This will work because the CRTPF creates a file where file name, recordformat name, member name and the single field name is all the same (in this case 'MYFIEL'). Henrik > > -------Original Message------- > > From: Midrange Systems Technical Discussion > Date: Friday, October 31, 2003 5:41:09 AM > To: Midrange Systems Technical Discussion > Subject: How do i select few fields in this file > > Hi all, > > My cl program is as follows : > > PGM > > YCTAC200C REQSFILE(REQS) POSFILE(POSF1) > OUTFILE(JAC200) > > ENDPGM > > JAC200 file (with 12 fields) like as follows > > FIRM OFF ACC ACCT CLS SUB SLSMN EQT EQTY IM EQTY EXCH > ------ ----- ------ ------- ----- ----- ------ ----- ------ ---- ---- > -------- > > Is there anyway I can copy this file(JAC200) into another file JAC2001 with > only 4 fields?....does copy file command allows me to pick up only 4 fields > from JAC200 to JAC201..I ve to include this copy file command to create > JAC201 with 4 fields only after the creation of the file JAC200 ..can some > one help me with ideas? > > JAC201 should look like > > FIRM OFF ACC IM > > > > Thanks in advance for ur help, > > Murali. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.