Jump to content

Hi All Working on data migrator console. Is it possible to c...


Tepe Moahloli

Recommended Posts

Hi All

Working on data migrator console. Is it possible to create a delimited file synonym for a csv file with header & trailer rows I am only interested in the data in the file. Example below

 

image.png1524265 45.5 KB

 

Bonus question : Is it possible to create synonym for a csv file with multiple sections

 

image.png1711333 40.6 KB

Link to comment
Share on other sites

I think yes to both questions, because you can build hierarchies of differing record types with SEGMENTs PARENT relationships. For example, try creating these files in baseapp and run the fex. Note the PCOMMA=ON needs to be invoked for the COM to work.

 

htcom.txt

"HEADER","MI","Michigan"

"DETAIL","Detroit"

"DETAIL","Troy"

"DETAIL","Kalamazoo"

"TRAILER","The trailer record"

 

 

htcom.mas

FILE=HTCOM, SUFFIX=COM, DATASET='baseapp/htcom.txt', $

SEGNAME=HEADER, SEGTYPE=S1, $

FIELDNAME=RECTYPE, ALIAS=HEADER, USAGE=A7, ACTUAL=A7, $

FIELDNAME=ST, ALIAS=ST, USAGE=A4, ACTUAL=A4, $

FIELDNAME=STNAME, ALIAS=STNAME, USAGE=A35, ACTUAL=A35, $

SEGNAME=DETAIL, SEGTYPE=S1, PARENT=HEADER, $

FIELDNAME=RECTYPE, ALIAS=DETAIL, USAGE=A7, ACTUAL=A7, $

FIELDNAME=CITY, ALIAS=CITY, USAGE=A25, ACTUAL=A25, $

SEGNAME=TRAILER, SEGTYPE=S1, PARENT=HEADER, $

FIELDNAME=RECTYPE, ALIAS=TRAILER, USAGE=A7, ACTUAL=A7, $

FIELDNAME=MESSAGE, ALIAS=MESSAGE, USAGE=A50, ACTUAL=A50, $

 

 

htcom.fex

SET ALL=ON

SET PCOMMA=ON

TABLE FILE HTCOM

PRINT ST

STNAME

CITY

MESSAGE

END

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...