This is actually a KSH under Unix System Services (Z/OS), but hoping I can get a standard AIX/KSH solution to work...
I have a very large, single line file in Windows, that we download via FTP, with the "SITE WRAP" option, into a Z/OS file with an LRECL of 200. This essentially breaks the single long line down into multiple 200 byte records.
We are converting from FTP, to (OPENSSH) SFTP, which unfortunately does not include the "SITE WRAP" ability. Therefore, I'm attempting to come up with another means of accomplishing the task.
I have downloaded the file to USS, and have written a simple script to read in the record and split it out into multiple, 200 byte records, and write those out to a new file...
#!/bin/ksh
echo 'Starting break..'
rm -f /homesh/ljamoo/SEQMAST2
CPOS=1
echo 'Loop..'
while read TLINE
do
NLINE=`expr substr $TLINE $CPOS 200`
echo $NLINE >> /homesh/ljamoo/SEQMAST2
CPOS=`expr $CPOS + 200`
done </homesh/ljamoo/SEQMAST
echo 'Done.'
exit
However, this is not working as USS is apparently unable to read in the entire record into the TLINE variable...
Starting break..
Loop..
read: /homesh/ljamoo/scripts/break.sh 6: FSUM9225 no memory: EDC5132I Not enough memory.
/homesh/ljamoo/scripts/break.sh 11: FSUM9225 no memory: EDC5132I Not enough memory.
/homesh/ljamoo/scripts/break.sh 11: FSUM9225 no memory: EDC5132I Not enough memory.
/homesh/ljamoo/scripts/break.sh 11: FSUM9225 no memory: EDC5132I Not enough memory.
....
So, does anyone have any suggestions on how else to break it down? Being a mainframe dinosaur, I have yet to wrap my head around the "sed" and "awk" commands, but hoping maybe there is something like that, which would accomplish this.
Thanks!