MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Spaces in VB file
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
LaluMon
Beginner


Joined: 28 Dec 2002
Posts: 21
Topics: 7

PostPosted: Mon Feb 03, 2003 10:19 pm    Post subject: Spaces in VB file Reply with quote

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'.

Is there a JCL solution to this?
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Feb 03, 2003 10:27 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Feb 04, 2003 6:31 am    Post subject: Reply with quote

Lalumon,

what is the LRECL of the VB file?? And what is the special character you want at the end of the file?

Thanks

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LaluMon
Beginner


Joined: 28 Dec 2002
Posts: 21
Topics: 7

PostPosted: Tue Feb 04, 2003 7:35 pm    Post subject: Reply with quote

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.

Regards
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Feb 05, 2003 3:07 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Feb 05, 2003 5:13 pm    Post subject: Reply with quote

Lalumon,

If you have easytrieve at your shop then the following Jcl will give you the desired results.

Code:

//STEP0100 EXEC PGM=EZTPA00                             
//*                                                     
//STEPLIB  DD DSN=EASYTREV.LOADLIB,           
//            DISP=SHR                                   
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSSNAP  DD SYSOUT=*                                   
//SYSUDUMP DD SYSOUT=*                                   
//FILEIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR                                   
//OUTPUT   DD DSN=YOUR OUTPUT FILE WITH DELIM,                     
//            DISP=(NEW,CATLG,DELETE),                   
//            UNIT=SYSDA,                                 
//            SPACE=(CYL,(X,Y),RLSE),                 
//            DCB=(LRECL=32000,RECFM=VB,BLKSIZE=32004)   
//*                                                     
//SYSIN    DD *                                         
                                                         
                                                         
  FILE FILEIN                                           
       KEY-REC          01    31999 A                   
       DELIM            32000 01    A                   
                                                         
                                                         
  FILE OUTPUT                       
                                                                       
***********************************************************************
* MAINLINE                                                            *
***********************************************************************
                                                                       
 JOB INPUT FILEIN                                                     
                                                                       
   DELIM = '{'                                                         
   PUT OUTPUT FROM FILEIN                                             
/*


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LaluMon
Beginner


Joined: 28 Dec 2002
Posts: 21
Topics: 7

PostPosted: Wed Feb 05, 2003 10:41 pm    Post subject: Reply with quote

Kolusu, unfortunately we dont have EZtrieve in our shop.

But we do have DFSORT...

Frank, it would be very helpful of you, if you could provide the EXIT routine for this.

Regards!
Back to top
View user's profile Send private message
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Thu Feb 06, 2003 11:40 am    Post subject: Reply with quote

Do you have VISION: Results (AKA DYL-280) in your shop?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Feb 06, 2003 12:10 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Feb 06, 2003 2:06 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LaluMon
Beginner


Joined: 28 Dec 2002
Posts: 21
Topics: 7

PostPosted: Thu Feb 06, 2003 9:05 pm    Post subject: Reply with quote

Thank You Very Much, Frank ! I really needed to get this working soon !

CaptBill, we dont have VISION here.

Semigeezer, I already looking into LOCSITE options and was struggling with that. I am initiating FTP from MVS to NT...I will explore more on that.

It is really wonderful that I have a solution now, thanks much to Frank !

Regards all.
Back to top
View user's profile Send private message
nova127
Beginner


Joined: 16 Oct 2004
Posts: 5
Topics: 1
Location: Rensselaer, New York

PostPosted: Sat Oct 16, 2004 1:48 am    Post subject: Using FTP to transfer a VB file to MS Server Reply with quote

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.

Any help would be greatly appreciated.

Thank You.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Sat Oct 16, 2004 3:17 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
nova127
Beginner


Joined: 16 Oct 2004
Posts: 5
Topics: 1
Location: Rensselaer, New York

PostPosted: Mon Oct 18, 2004 8:56 am    Post subject: Using FTP to transfer a VB file to MS Server Reply with quote

What product should I use to verify the data content on the MS Server?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Oct 18, 2004 9:22 am    Post subject: Reply with quote

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').
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group