Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Long COPY statement to be split
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Long COPY statement to be split
 Login/Join
 
Platinum Member
posted
I am trying to split a long line of code that copies lots of small files into one but I seem to have to put the statement all on one line.
ie.
COPY /A FILE1.TXT + /A FILE2.TXT + /A FILE3.TXT + /A FILE4.TXT + /A FILE5.TXT DESTFILE6.TXT

I can't seem to do this however:-
COPY /A FILE1.TXT +
/A FILE2.TXT +
/A FILE3.TXT +
/A FILE4.TXT +
/A FILE5.TXT
DESTFILE6.TXT

I get unrecognized command errors.
Any suggestions as to how you split a long line ?

This message has been edited. Last edited by: FP Mod Chuck,


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 190 | Location: London, UK | Registered: December 06, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
  -*-*From my understanding, You looking something like this.


-*-*-*-*This is for PDF

TABLE FILE CAR
PRINT
CAR NOPRINT
COMPUTE COL/A100='[b]Hello, Good morning.[/b]'|'^'|'HELLO';
COMPUTE COL/A100='[b]Cap Cash[/b]';
COMPUTE LINE_FEED/A100=CTRAN(100,COL,94,13,'A100');
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
UNITS=IN,PAGESIZE='Letter',SQUEEZE=ON,MARKUP=ON,LEFTMARGIN=0.1667,RIGHTMARGIN=0.250000,TOPMARGIN=0.0,ORIENTATION=LANDSCAPE,LINEBREAK='CR',$
TYPE=REPORT,FONT='ARIAL',SIZE=8,STYLE=NORMAL,LEFTGAP=0.025,RIGHTGAP=0.025,TOPGAP=0.02,BOTTOMGAP=0.02,BORDER=OFF,$
ENDSTYLE
END
-RUN

-*-*-*-*This is for HTML
TABLE FILE CAR
PRINT
CAR
COMPUTE COL/A100='[b]]Hello, Good morning.[/b]'|'<BR>'|'HELLO';
-*COMPUTE COL/A100='[b]Cap Cash[/b]';
COMPUTE LINE_FEED/A100=CTRAN(100,COL,94,13,'A100');
-*COMPUTE FLAG/A2='3';
-*ON TABLE HOLD AS HOLD_COL_3 FORMAT ALPHA
END
-RUN



WebFOCUS 7.X.X, 8.X.X
Windows, All Outputs
 
Posts: 54 | Registered: February 02, 2016Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thanks Pav. Not quite what I was looking for. Really just wanted to know the systax for breaking up a long line of essentially DOS code within a focexec.


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 190 | Location: London, UK | Registered: December 06, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Ian,

Look at using SYSTEM

-SET &CMD = 'COPY /A FILE1.TXT + /A FILE2.TXT + /A FILE3.TXT + /A FILE4.TXT + /A FILE5.TXT DESTFILE6.TXT';
-SET &MyRetCode = SYSTEM(&CMD.LENGTH, &CMD.QUOTEDSTRING, 'D4');


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.05 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.05 standalone on Windows 10 
 
Posts: 5508 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi Tony,
Am not quite sure what your suggestion using SYSTEM actually does but I tried it and it worked like a treat. Just what I wanted.
Thanks,
Ian


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 190 | Location: London, UK | Registered: December 06, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Ian,

The SYSTEM function allows you to run a system command but, unlike using the normal ! or CMD etc., it assigns the return code from the system command to a variable so that you can check it before continuing.

So, in effect, using SYSTEM waits for the system command to finish before continuing whereas using !, CMD etc. does not.

It is also easier (IMHO) to keep a long system command complete and within a single variable.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.05 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.05 standalone on Windows 10 
 
Posts: 5508 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
And, if it is just the DOS syntx you're looking for (as it would be used in a bat file) it is like this:
copy /A file1.txt + ^
     /A file2.txt + ^
     /A file3.txt + ^
     /A file4.txt + ^
     /A file5.txt + ^
     /A file6.txt + ^
     /A file7.txt + ^
     /A file8.txt files.txt


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thanks both GamP and TonyA - both great suggestions.


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 190 | Location: London, UK | Registered: December 06, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Just one further point re GamP's suggestion. I couldn't get the ^ continuation symbol to work when typed directly into a focexec.


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 190 | Location: London, UK | Registered: December 06, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
That would be correct. The syntax is pure DOS, not to be used within a fex.


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
OK thanks for the confirmation. I expected as much.
Ian


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 190 | Location: London, UK | Registered: December 06, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Long COPY statement to be split

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.