Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Dynamic file read via JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Fri Aug 14, 2020 11:51 am    Post subject: Dynamic file read via JCL
Reply with quote

Hi All,

Need a help to the perform the below requirement.

1. I have an input file like the one below,

Code:

jobcode    dataset     
A             H1279CN.DATASET1
B             H1279CN.DATASET1
A             H1279CN.DATASET2
A             H1279CN.DATASET3
C             H1279CN.DATASET1


2. I need to read through the above file, open the dataset, fetch the trailer record from that file and write it in another output file.
Ex: For Jobcode A - fetch H1279CN.DATASET1 and get the trailer record, then go for H1279CN.DATASET2 and so on.
Once jobcode A is done, need to go for jobcode B & C, likewise till the end of input file.

Can you please let me know if this can achieved via JCL ?.
Back to top
View user's profile Send private message

Apoorva

New User


Joined: 28 Jan 2020
Posts: 46
Location: India

PostPosted: Fri Aug 14, 2020 12:07 pm    Post subject: Re: Dynamic file read via JCL
Reply with quote

abdulrafi wrote:
Hi All,

Need a help to the perform the below requirement.

1. I have an input file like the one below,

Code:

jobcode    dataset     
A             H1279CN.DATASET1
B             H1279CN.DATASET1
A             H1279CN.DATASET2
A             H1279CN.DATASET3
C             H1279CN.DATASET1


2. I need to read through the above file, open the dataset, fetch the trailer record from that file and write it in another output file.
Ex: For Jobcode A - fetch H1279CN.DATASET1 and get the trailer record, then go for H1279CN.DATASET2 and so on.
Once jobcode A is done, need to go for jobcode B & C, likewise till the end of input file.

Can you please let me know if this can achieved via JCL ?.


This can't be achieved just by using JCL. You need to use either COBOL or REXX to do this. You need to first read the main dataset, and then dynamically allocate H1279.* datasets to read them. If you choose to use COBOL then you could use BPXWDYN interface to dynamically allocate H1279 datasets.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1087
Location: Dublin, Ireland

PostPosted: Fri Aug 14, 2020 12:49 pm    Post subject:
Reply with quote

When you say "write it in another output file", are all the trailers written to the same output dataset?
Do the trailer records have a common identifier?

If both, then you could use your SORT product to extract the trailers to the output dataset.

If output is to different datasets, you could run separate SORTs (which could be dynamically invoked from, say, REXX).

Garry
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Fri Aug 14, 2020 3:32 pm    Post subject:
Reply with quote

Garry - But I would need to loop through the input file (where the actual dataset name is present which I need to open). I have to open this dataset and then read the data. Will I be able to do it in JCL ?.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1217
Location: Vilnius, Lithuania

PostPosted: Fri Aug 14, 2020 3:37 pm    Post subject:
Reply with quote

No.

Full stop. Period. End of story.

Now get your backside out of here to the beginners forum, because you've obviously learned nothing in the 11 years that you've been calling yourself a "Software engineer"!
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Group selective VB records - Trailer ... Premnath_TJ DFSORT/ICETOOL 12 Sun Sep 13, 2020 3:38 am
No new posts TWS - ETT File triggering does not wo... me00266 IBM Tools 4 Mon Sep 07, 2020 11:58 pm
No new posts How to process dependent file based o... HithaSri JCL & VSAM 7 Sun Sep 06, 2020 12:42 pm
No new posts Dynamically read input files using BP... Srinivas B COBOL Programming 20 Sat Sep 05, 2020 1:48 pm
No new posts EIBRESP=16 and EIBRESP2=25 while doi... sancraig16 CICS 2 Thu Sep 03, 2020 2:53 am

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