Hello,
I build an IFS path for a CPYTOIMPF command in my program and I was wondering if there was a way to do this through a datastructure? The issue here being that one of the field has a varying length of data, it could be 4 or it could be 11 characters
Here's a simple example, to demonstrate what I'm trying to do;
So during processing, the client name will be read from a field in a file and set - the issue being it could be 4 characters or 11.
Naturally, because I've defined it as 11 long, when the field is referenced it has trailing blanks;
Is there any special way to define #Client so that the blanks are auto-trimmed?
I tried the "Varying" keyword but this gave a weird result and from reading about it, I think it's how it is stored rather than displayed;
That square shows as a ? on the iSeries display.
Thanks in advance,
Ryan
I build an IFS path for a CPYTOIMPF command in my program and I was wondering if there was a way to do this through a datastructure? The issue here being that one of the field has a varying length of data, it could be 4 or it could be 11 characters
Here's a simple example, to demonstrate what I'm trying to do;
Code:
D #IFS Ds D #IFSPath D #IFSDir 15a OVERLAY(#IFSPATH) D INZ('/ifs/directory/') D #Client 11a OVERLAY(#IFSPATH:*NEXT) D #Space 1a OVERLAY(#IFSPATH:*NEXT) INZ(' ') D #Date 7a OVERLAY(#IFSPATH:*NEXT) D INZ('03-2018') D #Ext 4a OVERLAY(#IFSPATH:*NEXT) INZ('.CSV') #Client = 'Client'; Dsply #IFS; *INLR = *ON;
Naturally, because I've defined it as 11 long, when the field is referenced it has trailing blanks;
Code:
DSPLY /ifs/directory/Client 03-2018.CSV
I tried the "Varying" keyword but this gave a weird result and from reading about it, I think it's how it is stored rather than displayed;
Code:
DSPLY /ifs/directory/ ■Client 03-2018.CSV
Thanks in advance,
Ryan
Comment