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

Cobol to fetch the content by using start,end filed in a PS


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
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
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: 2455
Location: Hampshire, UK

PostPosted: Fri Nov 17, 2017 1:39 pm
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
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: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Nov 17, 2017 3:32 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Nov 17, 2017 4:05 pm
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
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top