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
 
Cobol to fetch the content by using start,end filed in a PS

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
arunc55

New User


Joined: 15 Nov 2017
Posts: 2
Location: India

PostPosted: Fri Nov 17, 2017 1:25 pm    Post subject: Cobol to fetch the content by using start,end filed in a PS
Reply with quote

Hi All,

I'm working on a program to fetch the content of data from a PS file by giving the input as start field and end filed.

For example:

It consist of three input files
Input 01 is PS file contains the data
Code:
15 ALPHABET-($).                               
                17 ABC-($)      PIC 9(3).             
                17 DEF-($)      PIC 9(3).             
                17 GHIJK-($)    PIC 9(5).             
                17 LMNO-($)     PIC 9(4).             
                17 PQRSTU-($)   PIC 9(6).             
                17 VWXYZ-($)    PIC S9(5)      COMP-3.


Input 02 will be passed through JCL and it's group name ALPHABET-($)

Input 03 will be passed through JCL and it's variable name LMNO-($)

The desired output is:

Code:
15 ALPHABET-($).                               
  17 ABC-($)      PIC 9(3).             
  17 DEF-($)      PIC 9(3).             
  17 GHIJK-($)    PIC 9(5).             
  17 LMNO-($)     PIC 9(4). 


Can someone please help me out to solve this through a sample cobol.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1932
Location: UK

PostPosted: Fri Nov 17, 2017 1:39 pm    Post subject:
Reply with quote

Nope.

What do you mean by
Quote:
passed through JCL
? What JCL? What programs is the JCL executing?

Your progam input is a data structure and your desired output is the same data structure, left-shifted and a couple of the fields removed? So what are the other 2 data sets (they are not 'files')?
Back to top
View user's profile Send private message
arunc55

New User


Joined: 15 Nov 2017
Posts: 2
Location: India

PostPosted: Fri Nov 17, 2017 2:56 pm    Post subject:
Reply with quote

Hi Nic,

Please consider the below explanation

The input 01 consist the below

Code:
15 ALPHABET-($).                               
  17 ABC-($)      PIC 9(3).             
  17 DEF-($)      PIC 9(3).             
  17 GHIJK-($)    PIC 9(5).             
  17 LMNO-($)     PIC 9(4).             
  17 PQRSTU-($)   PIC 9(6).             
  17 VWXYZ-($)    PIC S9(5)      COMP-3.


The input 02 consist the below (start field)

Code:
ALPHABET-($)


The input 03 consist the below (end field)

Code:
LMNO-($)


So here what I need is, the program should read all the inputs and need to fetch the fields from start field to end field from input 01 and write into an output file

So the desired output should be,

Code:
15 ALPHABET-($).                               
  17 ABC-($)      PIC 9(3).             
  17 DEF-($)      PIC 9(3).             
  17 GHIJK-($)    PIC 9(5).             
  17 LMNO-($)     PIC 9(4).
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1072
Location: Oostende, Belgium

PostPosted: Fri Nov 17, 2017 3:32 pm    Post subject:
Reply with quote

And which PHB has come up with this ludicrous requirement?

Quote:
Can someone please help me out to solve this through a sample cobol.

Which, cynic mode on, really means: Can anyone do my work for me.

This is a forum for experts, and experts charge at least USD/EUR/GBP 100 per hour. Are you prepared to pay?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Fri Nov 17, 2017 4:05 pm    Post subject: Reply to: Cobol to fetch the content by using start,end filed in a PS
Reply with quote

if You look at the top left of the page You will see
EXPERT FORUM

and You qualify Yourself as
Quote:
software engineer
Mainframe Skills: COBOL,JCL,DB2


unfortunately the question You asked really does not qualify You as an expert
and certainly not skilled in COBOL

You might be better off migrating here
http://www.ibmmainframeforum.com/
A Help & Support Forum for Mainframe Beginners

topic locked
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

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