Below is my scenario, I am doing FTP from mainframe to Unix.
My input file will be having file names, for that I need to create FTP cards.
I/P file:
AAAA.BBBB.CCCC
AAAA12.CCCCC.HHHH
BBBB.UUUUU.FFFFF
My outfile should be
MK 'AAAA.BBBB.CCCC.&Time'
CD 'AAAA.BBBB.CCCC.&Time'
PUT AAAA.BBBB.CCCC AAAA.BBBB.CCCC
MK 'AAAA12.CCCCC.HHHH.&Time'
CD 'AAAA12.CCCCC.HHHH.&Time'
PUT AAAA12.CCCCC.HHHH AAAA12.CCCCC.HHHH
MK 'BBBB.UUUUU.FFFFF.&Time'
CD 'BBBB.UUUUU.FFFFF.&Time'
PUT BBBB.UUUUU.FFFFF BBBB.UUUUU.FFFFF
While creating the FTP cards, I need to add Time stamp to the Directory names, I know the starting position of the files names in infile but I don know the length. Can anyone please help me to get this out. Is it possible in sort or Icetool?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Is &Time a hardcoded constant of '&Time' or do you want to substitute the current system time for it? If you want the system time, in what format do you want it (hhmmss or ?)?
What is the RECFM and LRECL of the input file? What do you want for the RECFM and LRECL of the output file?
Quote:
While creating the FTP cards, I need to add Time stamp to the Directory names
MK 'XXXXXXX.XXXX.YYYY.ZZZZ.195641'
CD 'XXXXXXX.XXXX.YYYY.ZZZZ.195641'
PUT XXXXXXX.XXXX.YYYY.ZZZZ XXXXXXX.XXXX.YYYY.ZZZZ
The file name is getting truncated in all the 3 lines.
Here the problem is on line3 because the file name truncating in LINE3.In line3 the whole file name should be present . Because I am going to FTP that file from mainframe to unix. But I am not know the length of my input file names.
I will use the sort step output file is my input to FTP step.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You didn't say how long your names could be, but all of the names in your example had three nodes so I assumed the names could be at most 30 characters (based on 8.8.8 = 26 so I used 30).
XXXXXXX.XXXX.YYYY.ZZZZA
is 23 characters so it works fine. When I run my job with that name, I get the following output:
MK 'XXXXXXX.XXXX.YYYY.ZZZZA.131258'
CD 'XXXXXXX.XXXX.YYYY.ZZZZA.131258'
PUT XXXXXXX.XXXX.YYYY.ZZZZA XXXXXXX.XXXX.YYYY.ZZZZA
No truncation.
If you're getting truncation, then you either changed my job or are doing something else you're not telling me about.
Quote:
I am not know the length of my input file names.
You'd need to be able to tell me the maximum length of the names in order for me to give you a solution that would work for the longest name. Since you said the LRECL is 80, the name couldn't be larger than that, but an 80-byte name would certainly result in an output record greater than 80 bytes. So I assume the maximum name would actually be less than 80 bytes. What length would you want me to use, and if it resulted in an output record greater than 80 bytes, would that be a problem?
Frank again my requirement has been changed now. Can you please help me out.
Here also I am going to create FTP control Cards,
My Infile1 is - Lrecl = (252 + 4) = 256, Format = VB.
My infile2 is - 125 VB
Infile1 Contains below,
IPadd :- Start pos - (190 + 4), len - 20
User Name :- Start pos - (220 + 4), len - 8,
Pass /- Start pos - (240 + 4), len - 8,
Path :- Start pos - (130 + 4), len - 48,
Path maximum length is 48 but it may decrease. I am not know the exact position.
My infile2 contains:- Filenames :- Start pos - (3 + 4), len - 44,
AAAA.YYYYY.ZZZZZ
XXXXX.DDDD.KKK.XXX
I will be having more than n number of files and also length of the files will vary from file to file.
My output is 125 VB. it should contain
IPadd (3,20)
Username (3 ,8)
password ( 3,8)
Mk 'path.sdir.&time'
CD 'path.sdir.&time'
PUT 'AAAA.YYYYY.ZZZZZ' 'AAAA.YYYYY.ZZZZZ'
'XXXXX.DDDD.KKK.XXX' 'XXXXX.DDDD.KKK.XXX'
QUIT
IN MK and CD I need to add sdir.&time as suffix. &TIME is system defined time.
In PUT i will be having N number of files to ftp. But my infile and outfile name is same.
Last line i need to add 'QUIT'
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Sorry, but I can't follow your description.
Please show an example of the records in your input file covering all of the significant variations and what you expect for output. Where the length of a "field" or "fields" can vary, give the maximum length possible.
My infile2 contains:- 125, VB . Start pos -3, len - 44. It will contain only the file names to be ftpied.It may have 'N' of file names as below.
AAAA.YYYYY.ZZZZZ
XXXXX.DDDD.KKK.XXX
My output is 125 VB. it should be as below,
IPadd
Username
password
Mk 'PATH.sdir.&time'
CD 'PATH.sdir.&time'
PUT 'AAAA.YYYYY.ZZZZZ' 'AAAA.YYYYY.ZZZZZ'
PUT 'XXXXX.DDDD.KKK.XXX' 'XXXXX.DDDD.KKK.XXX'
QUIT
The Ipaddress, Username, password, PATH will come from input file1.
Using 'PATH' I need to create 2 lines. as MK 'PATH.SDIR.&TIME' and CD 'PATH.SDIR.&TIME'
Files names to be Ftpied will come from Input file2. I need to generate the lines in output file depends on number of file names in my input file2.
The Files names should come as
PUT 'FILENAME' 'FILENAME'
My trailer record should be 'QUIT'
Thanks for you reply.
There is no separate path1 and path2. Both are same only. The maximum will be 48. It may varying. But may decrease some time (i.e) 35 etc but It will not increase.
Yes there should be no blanks between path,sdir and time in MK and CD. (i.e 'PATH.SDIR.&TIME' ) but it should in between quoted string. There should be a space between MD and 'PATH.SDIR.&TIME' .
sdir is hardcoded value. it is not a variable.
In put should be as below.
PUT 'AAAA.YYYYY.ZZZZZ' 'AAAA.YYYYY.ZZZZZ'
I need a two space in between everything in put statement.
You can ask any input and output. I will send it to your mail id.