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: 2020
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: 1109
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

Senior Member


Joined: 14 Mar 2007
Posts: 10478
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 Need help - DB2 Dynamic SQL Program e... NikhilGuptaGaya DB2 0 Sat Jun 23, 2018 1:58 pm
This topic is locked: you cannot edit posts or make replies. Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm
No new posts VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm

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