View previous topic :: View next topic
|
Author |
Message |
shanudarling Warnings : 1 New User
Joined: 20 Dec 2006 Posts: 55 Location: noida
|
|
|
|
I have an sequential input file which contains some numbers for example -
Code: |
101
102
103
104
105
106 |
My requirement is to use jcl to read the contents of the file and for each record I have to ftp the record into a file and each file should be created by a unique name.
So for the above contents, I will need to run the ftp step 6 times and 6 new files will be created.
The content of the 1st file will be 101, 2nd file will be 102 and so on.
6 new files will be created and will have a unique name.
Need to know if someone has worked on a similar requirement or if someone has any idea how this can be done.
Please help.
Thanks in advance. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
Need to know if someone has worked on a similar requirement or if someone has any idea how this can be done. |
if You do not like YES/NO answers, do not ask YES/NO questions
anyway NO,YES
from Your profile
Quote: |
Mainframe Skills: everything |
so why ask.... You should be able to do it on Your own ?
PS..
Quote: |
JCL - Handling Loop |
certainly the skill of using a proper title for a muddy requirement was a bit overestimated ! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Your requirement is totally impossible as JCL can not read anything
A bit like your requirement actually, so where are we going to ftp this stuff to. What O/S will the recipient system be running. What naming standards are applicable for that platform.
Sorry, but psychic day was Wednesday this week
As for suggestions,
REXX / ISPF to create and submit the required JCL
REXX / ISPF to dynamically invoke ftp |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
JCL - is a Job Control Language. The word "language" in it, has been mis-intrepeted many times in the sense that JCL does work similar to any "programming language". JCL, in its very sense - is a control language used to identify a job to an operating system and to describe the job's requirement and that's it. In simple terms, JCL won't handle any loop!
To get you started - possibly you can use SORT (as you said JCL) as the first step in your Job to get the "number of files" and then add as many FTP steps as the number-of-records in input.
You might also consider to dynamically generate the FTP statements and execute using interanl reader. There are examples on the fora about generating such jobs. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
assumptions
the <target> system for FTP is one
the <target> system is not completely an idiot ( is not a WIDOZE thing )
then it would be much simpler to have the target system do the donkey work
ftp just the number list, on the target system write a simple script to read the FTPed data and create the target files accordingly
to do that would be a dataset management nightmare... create zillions of one liners, FTP them, DELETE them... just sickening! |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
So, put the contents of the dataset into a PDS, with one member for each unique record of data. Then FTP the entire PDS with a single MPUT command. The member names will be the target system filenames.
Or, through a program, convert each record of the dataset into a DD statement and a corresponding FTP PUT statement. |
|
Back to top |
|
|
|