IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To create Multiple FTP cards using sort/ICETOOL.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jeyaseelan347
Warnings : 1

New User


Joined: 05 Sep 2008
Posts: 37
Location: Chennai

PostPosted: Wed Nov 05, 2008 2:39 pm
Reply with quote

Hi all,

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?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 05, 2008 10:50 pm
Reply with quote

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


What does this mean in terms of your example?
Back to top
View user's profile Send private message
jeyaseelan347
Warnings : 1

New User


Joined: 05 Sep 2008
Posts: 37
Location: Chennai

PostPosted: Wed Nov 05, 2008 11:31 pm
Reply with quote

Thanks you so much for you reply FRANK.
I need current system time. HHMMSS is fine for me. RECFM is FB and LRECL is 80.

I need to create Input parameters for my FTP JCL. In that I to need to add Time stamp to my directory name.

Is this possible in IBM by using DFSORT/ICETOOL.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 05, 2008 11:57 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
    BUILD=(1,30,31:1,30,61:C'''',1,30,C'.',TIMENS=(24),C'''')),
   IFTHEN=(WHEN=INIT,OVERLAY=(1:1,60,SQZ=(SHIFT=LEFT,MID=C' '),
      61:61,40,SQZ=(SHIFT=LEFT)))
  OUTFIL REMOVECC,
   BUILD=(C'MK ',61,40,80:X,/,
    C'CD ',61,40,/,
    C'PUT ',1,60,/)
/*
Back to top
View user's profile Send private message
jeyaseelan347
Warnings : 1

New User


Joined: 05 Sep 2008
Posts: 37
Location: Chennai

PostPosted: Thu Nov 06, 2008 1:20 am
Reply with quote

Hi,

My input is,

XXXXXXX.XXXX.YYYY.ZZZZA

My output is,

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.

Is this possible?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 06, 2008 1:46 am
Reply with quote

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?
Back to top
View user's profile Send private message
jeyaseelan347
Warnings : 1

New User


Joined: 05 Sep 2008
Posts: 37
Location: Chennai

PostPosted: Fri Nov 07, 2008 10:30 pm
Reply with quote

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'

IS this possible in ICETOOL/DFSORT

Thanks in advance
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Nov 07, 2008 11:11 pm
Reply with quote

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.
Back to top
View user's profile Send private message
jeyaseelan347
Warnings : 1

New User


Joined: 05 Sep 2008
Posts: 37
Location: Chennai

PostPosted: Fri Nov 07, 2008 11:39 pm
Reply with quote

My requirement is, I need to FTP Multiple files in one FTP call. For that I need to create FTP control Cards.

The parameters for FTP (Username, password, IPadd, Path) will come from input file1

My files to be ftpied will be present in Input file2.

My Input file1 contain only one record( Username, password, IPadd, Path) Which will be 256 length and VB Format.

Infile1 Contains below, format is vb

IPaddress Start pos - 190, length - 20
UserName Start pos - 220, length - 8,
Password Start pos - 240, length - 8,
Path Start pos - 130, length - 48,

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'
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Nov 08, 2008 12:15 am
Reply with quote

Quote:
Path Start pos - 130, length - 48


The path can be 1 to 48 characters? For example:

Path1
Path2isalongername

And in the MK and CD output lines, you want to squeeze out the blanks? For example:

MK 'Path1.sdir.&time'
MK 'Path2isalongername.sdir.&time'

sdir - is this a hardcoded string of 'sdir' or 'SDIR' or is it a variable? If it's a variable, where does it come from?

In the PUT statements, do you only want one blank between the two quoted strings or can we use more than one blank?

I asked you for an example of input and output so I wouldn't have to ask these kinds of questions.
Back to top
View user's profile Send private message
jeyaseelan347
Warnings : 1

New User


Joined: 05 Sep 2008
Posts: 37
Location: Chennai

PostPosted: Sat Nov 08, 2008 12:40 am
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Nov 08, 2008 2:53 am
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1 (VB/256)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
     BUILD=(1,4,5:194,20,25:224,8,33:244,8,
       41:134,48,C'.SDIR.',TIMENS=(24)))
  OUTFIL VTOF,
    BUILD=(C'IPA,''',5,20,C'''',80:X,/,
      C'UNAME,''',25,8,C'''',/,
      C'PASS,''',33,8,C'''',/,
      C'PATH,',41,60,SQZ=(SHIFT=LEFT,LEAD=C'''',TRAIL=C'''',
        LENGTH=62))
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2 (VB/125)
//SORTOUT DD LRECL=125,DSN=...  output file (VB/125)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
    BUILD=(1,4,5:7,44,SQZ=(SHIFT=LEFT,LEAD=C'''',TRAIL=C'''',
      LENGTH=46))),
   IFTHEN=(WHEN=INIT,
    OVERLAY=(5:5,46,5,46,5:5,92,SQZ=(SHIFT=LEFT,MID=C'  ')))
  OUTFIL VLTRIM=C' ',
    BUILD=(1,4,IPA,/,
      1,4,UNAME,/,
      1,4,PASS,/,
      1,4,C'MK ''',PATH,C'''',/,
      1,4,C'CD ''',PATH,C'''',/,
      1,4,C'PUT',2X,5,92)
/*
Back to top
View user's profile Send private message
jeyaseelan347
Warnings : 1

New User


Joined: 05 Sep 2008
Posts: 37
Location: Chennai

PostPosted: Sat Nov 08, 2008 3:29 pm
Reply with quote

Thanks a lot frank
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top