Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi all friend,

Could Any body send me the code (with coding) of this
senario because I have tried but I am stucking somewhere so
Please reply ASAp with coding.

senario:Q: I have to write the flat file(FLAT1) into the
three different PFS (PF1,PF2 and PF3) with the respect of H
line data,
D line data and Z line data of flat file.

where
I have different data in flat file(FLAT1) which is
mentioned below with data.

H0929200909282009092820095529420003000073

D2222220006765555webservi001633.9909222009092820090924200951
8564380134049ROSNER TOYOTA OF FREDE FREDERICKSBURVA
224080000USA840840001633.99001633.99851856492689800208001915
511001633.990408490000000.0000000003446048
1,3 110793145 09070700351
372367 Rosner Motors

D3333320006774444webservi000271.2409222009092820090924200951
8564380134049ROSNER TOYOTA OF FREDE FREDERICKSBURVA
224080000USA840840000271.24000271.24851856492689800208001835
511000271.240930680000000.0000000003450293
1 110793254 09072100079
373933 Rosner Motors


Z0929200900000020001905.25


FLAT1 has the three pf data
H line-represents the header pf data,D-Represent Details
pf data,Z-Represents the trailer pf data

Now I have to write H line data of flat file into Header pf
(PF1),D line data of flat into datails pf(PF2) and
Z line data of flat file into pf(PF3) with the spefic
position(H,D and Z data of flat file into PF1, PF2 and PF3)
of
flat file.

Answer Posted / sekhar214

If you observe the data, the first letter of the data contains H,D or Z. Coding should be like this.

H Option (*NoDebugIO)
FFLAT1 IF E DISK Rename(FLAT1:RFLAT) PREFIX(A_)
FPF1 O E DISK
FPF2 O E DISK
FPF3 O E DISK
D
D
D
/FREE
READ FLAT1 ;
DOW NOT %EOF ( FLAT1 ) ;
IF %SUBST(A_FLAT1:1:1) = 'H' ;
WRITE RPF1 ;
ENDIF ;
IF %SUBST(A_FLAT1:1:1) = 'D' ;
WRITE RPF2 ;
ENDIF ;
IF %SUBST(A_FLAT1:1:1) = 'Z' ;
WRITE RPF3 ;
ENDIF ;


READ FLAT1 ;
ENDDO ;

*INLR = *ON ;




/END-FREE
YOU SHOULD HANDLE THE CODE , WHEN WRITING INTO PF1,PF2,PF3.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to handle duplicate error handling in RPG?

2228


How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...

1822


1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.

6370


Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?

1990


can any one help in hawkeye and turnover or any change management system plzzzzz or send the documents to my mail id :gvsp.as4@gmail.com

2353


What is a record lock error?

1700


Q:HI friends accually ihave one problem plesase let me know the alternate code of this code. Related field description of code: Add a field, CALvsPRD, "Calendar Day Starts Before/After Production Day" to the parameter set WRKORDER which accepts values 'A' or 'B' o B = Calendar Day Starts Before Production Day o A = Calendar Day Starts After Production Day o Any other value indicates the production and calendar dates are always the same. code: Automatic Execution Of *INZSR Subroutine /Z01 * retrieves WRKORDER field values. /Z01 * Calculate default Production Date and return it to caller. /Z01 * Production date defaults to system date /Z01 C Eval P@Pdate = %DATE() /Z01 * unless Calendar date starts Before PDN(production) date and /Z01 * system time is before PDN Start Time then /Z01 * PDN date is yesterday. /Z01 C If W@CALvsPRD = 'B' and /Z01 C %TIME() < %TIME (W@Strtime) /Z01 C Eval P@Pdate -= %Day(1) /Z01 * unless Calendar date starts After PDN date and /Z01 * system time is *GE PDN(production) Start Time then /Z01 * PDN date is tomorrow. /Z01 C ElseIf W@CALvsPRD = 'A' and W@Strtime > *Zero and /Z01 C %TIME() >= %TIME (W@STrtime) /Z01 C Eval P@Pdate += %Day(1) /Z01 C EndIf /Z01 C Eval *InLr = *On

2471


how can I tell when to replace the array?

1155


We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?

1201


during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.

1149


do you use message subfiles? What are the necessary keywords required coding a message subfile?

1081


which program rpg or cl is efficent to update a transaction onto a database file and why ?

1199


Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?

1868


write an RPG program to calculate the marks of 5 students (A,B, C, D, E)in 3 different subjects (eng, math, sci) an display on the screen

1253


what is the use of sflnxtchg?

1210