Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
JCL - Handling Loop

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: JCL - Handling Loop
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Fri Nov 11, 2011 2:56 pm    Post subject: Reply to: JCL - Handling Loop
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: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 11, 2011 3:08 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Nov 11, 2011 3:26 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Fri Nov 11, 2011 7:53 pm    Post subject: Reply to: JCL - Handling Loop
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

Moderator Team Head


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

PostPosted: Fri Nov 11, 2011 8:04 pm    Post subject: Reply to: JCL - Handling Loop
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts save SAY var loop. italo_pm CLIST & REXX 3 Sun Sep 04, 2016 3:06 am
No new posts ON ERROR handling soundarr PL/I & Assembler 2 Wed May 11, 2016 3:37 am
No new posts Exception Handling in Native Stored P... Mariraj DB2 1 Thu Feb 25, 2016 4:08 am
No new posts print out the correct info in LOOP? jackzhang75 CLIST & REXX 7 Wed Dec 23, 2015 10:39 pm
No new posts Using different values for Skeleton d... venksiv CLIST & REXX 8 Thu Sep 03, 2015 5:28 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us