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

JCL - Handling Loop


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Fri Nov 11, 2011 2:53 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Nov 11, 2011 2:56 pm
Reply with quote

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 ? icon_cool.gif

PS..
Quote:
JCL - Handling Loop

certainly the skill of using a proper title for a muddy requirement was a bit overestimated !
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Nov 11, 2011 3:08 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Nov 11, 2011 3:26 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Nov 11, 2011 7:53 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Nov 11, 2011 8:04 pm
Reply with quote

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
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts File Handling COBOL Programming 9
No new posts REXX - Dataset checking in a do forev... CLIST & REXX 6
No new posts Handling the numeric data in unstring... COBOL Programming 18
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
Search our Forums:

Back to Top