Updating HFS files in FileManager batch



Ask queries about other IBM Tools like Tivoli, COBTEST, Fault Analyzer, z/OS File Manager, Workload Simulator, APA, SCLM, Merge & Migration Tools etc...

Updating HFS files in FileManager batch

Postby MitchellSTL » Fri May 11, 2012 12:08 am

Problem (short):

Need to convert x'25' to x'15' in batch on an HFS (linux) file

Problem & what I've tried:

We have an xml file that is in the HFS / linux partition. The xml file was created with only linefeed's (LF). When I use OEDIT or OBROWSE, I can see LF is a hex 25. The problem is that every record has been put into onto one line. This doesn't work well in a batch cobol program. I need to do a global change of x'25' to x'15' to appease cobol. From linux, I've tried SED & TR commands. They all worked great on every character in the file EXCEPT the x'25'. I've tried executing IKJEFT01 and calling EDIT on the HFS file, but EDIT doesn't support HFS. I tried executing IKJEFT01 and calling OEDIT on the HFS file, but OEDIT utilized ISPF and will not work in batch. I was able to get FileManger via ISPF panels to do the global changes, but I cannot seem to get the batch FILEMGR to work. It responds with FMNBA317 Invalid input data set for function DSU(unsupported DSORG). The file is a variable length file (generated from another unix machine). The command I used in File Manager (ISPF) that worked was C ALL X'25' X'15'

I've tried DSEB & DSU in file manager batch & get the same FMNBA317 error message of unsupported DSORG

Anyone have any ideas of how to change the x'25' to x'15' in JCL? I'm open to any solution really. I just figured that if file manager can do it via ispf screens it should be able to do it via batch.

in OBROWSE, this is what my test file in hex looks like (for simplicity, erased all but two letters and the x'25'):

   Menu  Utilities  Compilers  Help                                             
 -------------------------------------------------------------------------------
 ISRBROBA  /u/tmam3/testing/ex2                       Line 00000000 Col 001 003
 Command ===>                                                  Scroll ===> CSR 
********************************* Top of Data **********************************
 ------------------------------------------------------------------------------
a.b                                                                             
828                                                                             
152                                                                             
 ------------------------------------------------------------------------------
******************************** Bottom of Data ********************************


TIA!
MitchellSTL
 
Posts: 27
Joined: Wed Feb 16, 2011 8:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Updating HFS files in FileManager batch

Postby BillyBoyo » Fri May 11, 2012 2:26 pm

Are you sure that your solution fixes the problem? How have you defined the file in your Cobol program? Lots of people are transferring files in that direction without having to do this change.

I assume the file itself is all "display" fields? No COMPutational fields in Cobol terms?

A way to make the change is with your Sort product, check in you documentation for the availability of FINDREP (find and replace). You can do X'26' for the IN and X'15' for the OUT.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Updating HFS files in FileManager batch

Postby MitchellSTL » Fri May 11, 2012 5:55 pm

Yes, it's all display fields. It's an XML file that has only LF's in it. When we FTP'd the file down from their site, it only shows one record -- a very LONG record.

I did find a work around. I used the "extattr -FLF filename.xml" in unix system services. Now when I copy the file from USS to MVS, the LF's are interpreted correctly. Just thought it was weird on how it was acting.
MitchellSTL
 
Posts: 27
Joined: Wed Feb 16, 2011 8:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Updating HFS files in FileManager batch

Postby BillyBoyo » Fri May 11, 2012 6:01 pm

OK. Also have a good look at documentation on FTP. Give it a good google as well, I think I've seen similar topics out there.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Updating HFS files in FileManager batch

Postby Robert Sample » Fri May 11, 2012 8:08 pm

Personally, I think you should address the issue with FTP since FTP can translate line termination characters from LF to CR/LF to record delimiters on a mainframe, but you could try File Manager batch:
//IN1      DD   PATH='/u/xyz/ptest.c',PATHOPTS=(ORDONLY)
//OUT1     DD   PATH='/u/xyz/ptest.changed.c',PATHOPTS=(OWRONLY)
//SYSIN    DD   *
$$FILEM DSC INPUT=IN1,OUTPUT=OUT1,PROC=*
CHG_OUT(X'25',X'15',0)
/*
although I have not tested this since I don't have any files with the characteristics you described.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Updating HFS files in FileManager batch

Postby MitchellSTL » Fri May 11, 2012 10:45 pm

I saw that there was a MBSENDEOL and SBSENDEOL command, but I think that only works on PUT commands. I'm issuing GET commands. If you know of a way, I'd rather perform through a locsite command or some other FTP conversion. :)

As for using File Manager, Here's my results..

DSC (I had to modify the pathopts so that the system would create the file for me)

//FILEIN   DD  PATHOPTS=(ORDONLY),PATH='/u/tmam3/iesar_original.xml'   
//FILEOUT  DD  PATH='/u/tmam3/iesar_deleteme.xml',                     
//             PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU       
//SYSIN     DD  *                                                     
$$FILEM DSC INPUT=FILEIN,                                             
$$FILEM     OUTPUT=FILEOUT,                                           
$$FILEM     PROC=*                                                     
  CHG_OUT(OUTREC,X'25',X'15',0)                                       
/*                                                                     
//*   


Results:

IBM File Manager for z/OS                                         
$$FILEM DSC INPUT=FILEIN,                                         
$$FILEM     OUTPUT=FILEOUT,                                       
$$FILEM     PROC=*                                                 
FMNBC514 REXX procedure statements read from SYSIN.               
                                                                   
  CHG_OUT(OUTREC,X'25',X'15',0)                                   
                                                                   
FMNBB060 REXX procedure statements processed by REXX.             
FMNBB392 CHANGE()/CHG_OUT() function count argument is not numeric
     9 +++  CHG_OUT(OUTREC,X'25',X'15',0)                         
     4 +++ CALL FMPRC                                             
IRX0040I Error running FMNINTEX, line 9: Incorrect call to routine
FMNBB382 REXX exec terminated with RC 20040                       
FMNBB336 Copy procedure terminated. 0 rec(s) copied               


DSU (my attempt)

//SYSIN     DD  *                     
$$FILEM DSU INPUT=FILEIN,             
$$FILEM     PROC=*                   
  OUTREC=CHANGE(OUTREC,X'25',X'15',0)
/*   


Results

IBM File Manager for z/OS                                                       
$$FILEM DSU INPUT=FILEIN,                                                       
$$FILEM     PROC=*                                                             
FMNBA317 Invalid input data set for function DSU(unsupported DSORG).           
FMNBB291 The user cancelled the function, or the function could not be performed
FMNBE098 Keyword verification discontinued for any subsequent command           
  OUTREC=CHANGE(OUTREC,X'25',X'15',0)
MitchellSTL
 
Posts: 27
Joined: Wed Feb 16, 2011 8:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Updating HFS files in FileManager batch

Postby Robert Sample » Fri May 11, 2012 10:52 pm

If you're doing a GET, then
QUOTE LOCSITE SBSENDEOL=....
should be acceptable. SITE is for the remote host, LOCSITE for the local host.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Updating HFS files in FileManager batch

Postby MitchellSTL » Sat May 12, 2012 12:41 am

Robert,

The way the manual was worded, it led me to believe that it only worked on PUTting a file. Regardless of what I thought, I still tried it. I used the following commands when FTP'ing into the vendor's FTP server. Didn't change it. But on a positive note, I did get the TR command to work while researching the SBSENDEOL command. This describes my problem to a "T". The guy posting's terminology is wrong, but this is what I'm getting as well.

http://www.mail-archive.com/ibm-main@bama.ua.edu/msg78550.html

//FTPBATCH EXEC PGM=FTP,COND=(0,NE),                       
//         PARM='FTPINTERNAL 21 (EXIT=00 TIMEOUT 180'       
//INPUT    DD *                                             
ANONYMOUS                                                   
NOPE@UHUH.COM                                               
ASCII                                                       
CD /TEMPDATA/TMAM3                                         
LOCSITE CYL LR=80 RECFM=F PRI=10 SEC=5 WRAP                 
LOCSITE SBSENDEOL=LF MBSENDEOL=LF                       
GET IES-AR-OF2012050310011987.XML /u/tmam3/binary.xml (REPL
/*
MitchellSTL
 
Posts: 27
Joined: Wed Feb 16, 2011 8:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Updating HFS files in FileManager batch

Postby Robert Sample » Sat May 12, 2012 5:25 am

Have you tried transferring as binary and using ICONV in Unix System Services?
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to Other IBM Tools

 


  • Related topics
    Replies
    Views
    Last post