Hi
Am trying to move a data structure to a flat file.The flat file field name is SASAM.
The error is The Result-Field operand SASAM is not valid for the
specified operation.
The data to be written is CCODE and then the value in HCMPYV.
Please find code snippet for ur reference
FSASAM IF A E DISK
F RENAME(SASAM:SA100)
D*HDR DS
D*HCMPY 1 11 INZ('CCode')
D*HCMPYV 12 13
SRHEAD BEGSR
MOVE HDR SASAM
WRITE SA100
ENDSR
Software/Hardware used:
ASKED:
January 6, 2009 4:07 PM
UPDATED:
January 6, 2009 6:39 PM
The * is in there by mistake…As regards the flat file when i use the crtpf to create the flat file by default the file gets created with the same name SASAM for file ,rcdfmt and the field name.Do i need to create a pf with dds that has only one field in whic case i may be able to give diffrerent names.
Can you please clarify if i need to move the data struct hdr to the file name or field name.
a sample may be of good help
For flat files
1. Create the file — CRTPF name library and record length
2. The F statement is Fixed not external length must match the data structure
3. write to the file result field = datastructure.
Here is example:
FSASAM O f 13 disk
Dhdr ds
D HCMPY 11 inz(‘CCode’)
D HCMPYV 2 inz(‘YV’)
C write SASAM hdr
C Eval *inlr = *on
C return