Posted: Mon Feb 03, 2003 10:19 pm Post subject: Spaces in VB file
Ok, I am asking this for my friend.....
Hello,
I have a VB input file. Some records have spaces as the last bytes of the records. Now I am
ftp-ing the file to NT and using it in an NT application. I am encountering problem as the trailing spaces in the records are truncated in the ftp.
To overcome this, I thought of adding a non-space character value to all the records when the last byte of that record is space. This non-space character needs to be added at the end of the record after the last space, x'40'.
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Mon Feb 03, 2003 10:27 pm Post subject:
Not JCL, but FTP. There is a keyword (TRAIL) that you can pass to the FTP server vit the LOCSITE or SITE commands to tell it not to remove trailing blanks. I'd suggest looking over the whole list. There are some useful ones there.
Thanks semigeezer! I will look into the options in the FTP.
Kolusu, I was planning to put a left paranthesis '{' as the last character of every record having spaces at the end. The LRECL of the VBfile is 32K, the MVS limitation.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Feb 05, 2003 3:07 pm Post subject:
Lalumon,
You could add the non-blank character with DFSORT using an E15 exit. If you use DFSORT and would like me to write the E15 exit for you, let me know. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Thu Feb 06, 2003 12:10 pm Post subject:
I tried 2 different MVS systems, with targets of Windows and Linux and FTP is not removing the trailing blanks anywhere (I never got LOCSITE TRAIL to work). Have you verified that there are trailing blanks in the data using ISPF browse (not edit or view) and HEX ON?
Also, are you initiating the FTP from NT or from the mainframe and what FTP client and server are you using? The best solution is to get FTP to work (assuming it is the culprit) rather than changing the data.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Feb 06, 2003 2:06 pm Post subject:
LaluMon,
Here is the DFSORT job that uses the exit:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//EXIT DD DSN=... library with E35VADD exit load module
//* USE LRECL=32756 FOR SORTIN TO ALLOW FOR MAX VB RECORD
//SORTIN DD LRECL=32756,BLKSIZE=32760,DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
MODS E35=(E35VADD,1000,EXIT)
/*
and here's the source for the E35VADD exit:
Code:
* E35 EXIT:
* IF THE LAST BYTE OF A VB RECORD IS BLANK, ADD A SPECIFIED
* CHARACTER AFTER THE BLANK AND INCREASE THE RECORD LENGTH BY 1.
*
E35VADD CSECT
*=====>
* CHANGE NEXT LINE TO CHARACTER YOU WANT TO ADD
ADD EQU C'{' CHARACTER TO ADD
*
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
STM R14,R12,12(R13) SAVE ALL REGS EXCPT 13
BALR R12,R0 SET BASE REG
USING *,R12 SHOW BASE REG
ST R13,SAVE35+4 SAVE BACKWARD POINTER
LA R14,SAVE35 SET FORWARD POINTER IN CALLER
ST R14,8(R13) SET SAVE AREA
LR R13,R14 SET OUR SAVE AREA
L R2,0(,R1) GET ADDRESS OF INPUT RECORD
* IF END OF INPUT, RETURN TO DFSORT WITH RC=8
LTR R2,R2 IF POINTER TO INPUT RECORD IS ZERO,
BZ EOI END OF INPUT
LR R14,R2 COPY POINTER TO INPUT RECORD
SLR R9,R9 GET THE LENGTH OF
ICM R9,3,0(R2) THE INPUT RECORD FROM THE RDW
LR R15,R9 COPY IT
BCTR R9,R0 GET OFFSET OF LAST BYTE OF RECORD
ALR R2,R9 GET POINTER TO LAST BYTE
CLI 0(R2),C' ' IF LAST BYTE IS BLANK,
BE ADDCHAR MUST ADD SPECIFIED CHARACTER
ACCEPT DS 0H
* LAST BYTE IS NOT BLANK - ACCEPT INPUT RECORD AS IS.
LR R1,R14 POINT TO INPUT RECORD
SLR R15,R15 TELL DFSORT TO ACCEPT RECORD
B GOBACK RETURN TO DFSORT
ADDCHAR DS 0H
* ADD SPECIFIED CHARACTER AS NEW LAST BYTE OF RECORD AND
* INCREASE THE RECORD LENGTH BY 1.
LA R4,NEWREC GET POINTER TO NEW RECORD BUFFER
LR R8,R4 COPY IT
LR R5,R15 COPY LENGTH
LR R9,R15 COPY LENGTH
MVCL R4,R14 MOVE INPUT RECORD TO BUFFER
LR R1,R8 POINT TO NEW RECORD
ALR R8,R9 POINT TO BYTE AFTER ENDING BLANK
* IN NEW RECORD BUFFER
MVI 0(R8),ADD MOVE IN SPECIFIED CHARACTER
AL R9,=F'1' ADD 1 TO RDW LENGTH
STCM R9,3,0(R1) SET IN NEW RECORD BUFFER
SLR R15,R15 TELL DFSORT TO ACCEPT NEW RECORD
B GOBACK RETURN TO DFSORT
EOI DS 0H
LA R15,8 TELL DFSORT NOT TO RETURN TO E35
*
GOBACK DS 0H
L R13,4(,R13)
L R14,12(,R13)
LM R2,R12,28(R13)
BR R14
*
SAVE35 DS 18F ENTRY REGISTER SAVE AREA
LTORG
NEWREC DS CL32756 BUFFER FOR CHANGED RECORD
END
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 16 Oct 2004 Posts: 5 Topics: 1 Location: Rensselaer, New York
Posted: Sat Oct 16, 2004 1:48 am Post subject: Using FTP to transfer a VB file to MS Server
I'm also trying to use FTP to transfer a VB file (max. 1000 bytes/record) from our MVS Mainframe to a Microsoft Server. I'm not an FTP Expert. I have used the "SENDSITE NOTRAIL" Command, but I'm still receiving trailing blanks in every record on the server, so that they all turn out to be 1000 bytes in length.
In case you didn't notice, the SENDSITE TRAIL/NOTRAIL options are only valid for Fixed-Length datasets. A Variable-Length dataset should not, by definition, have trailing blanks.
What are you using to verify the data content on the MS Server? Notepad/Worpad won't do.
Ultraedit works well, since it can represent the raw data in hexadecimal format.
Even better, have one of your Windows programmers take a dump of the data and look at the hexadecimal representation of the data, and count the number of bytes between Carriage-Return/Line Feeds. Look for a continuous string of characters that would indicate that the records are being padded (such as blanks, which are an ASCII x'20').
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum