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
 
regarding passing a file from sysin dd

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
ipavan

New User


Joined: 12 Jun 2005
Posts: 28
Location: Hyderabad

PostPosted: Thu Jul 21, 2005 6:24 pm    Post subject: regarding passing a file from sysin dd
Reply with quote

hi priyesh,

i am coding

// sysin dd *

lib'xxxx.yyy.zzzz'
//

this is a ps file . i want to access the data present in ps file. how to do that in the cobol program.
Back to top
View user's profile Send private message

anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Thu Jul 21, 2005 11:00 pm    Post subject:
Reply with quote

Hi ipavan!

We can't access the data inside the PS file, if we give that in SYSIN DD *. Why can't you use that as an input file.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Fri Jul 22, 2005 12:40 am    Post subject:
Reply with quote

Priyesh,
U can acess it if you are able to allocate it dynamically by calling Assemler routine DYNALLOC or by passing values to Language Environment Variable.

Below is the code to accept a file from SYSIN and allocate the file by passing the value to the Language Environment Variable and write a record to the file.
Code:

* DYNAMICALLY ALLOCATING DATASET USING LANG ENVIRONMENT     
* THIS PROGRAM SHOULD BE COMPILED WITH A NODYNAM OPTION     
* THE C MODULE SOULD BE CALLED STATICALLY                   
 IDENTIFICATION DIVISION.                                   
 PROGRAM-ID. DYNAM1.                                       
 AUTHOR. XXXXX.                                             
                                                           
 ENVIRONMENT DIVISION.                                     
 INPUT-OUTPUT SECTION.                                     
 FILE-CONTROL.                                             
     SELECT INPUT-FILE  ASSIGN TO DYNAFILE                 
           FILE STATUS IS DYN-STATUS.                       
                                                           
 DATA DIVISION.                                             
 FILE SECTION.                                             
 FD INPUT-FILE                                             
     RECORDING MODE IS F                                   
     BLOCK CONTAINS 0 RECORDS.                                   
 01 INPUT-RECORD           PIC X(80).                           
                                                                 
 WORKING-STORAGE SECTION.                                       
 01 ADDRESS-POINTER    POINTER.                                 
 01 FILE-ENVIRONMENT-VAR.                                       
 05 FILE-ENVIRONMENT-VAR1  PIC X(13) VALUE "DYNAFILE=DSN(".     
 05 FILE-ENVIRONMENT-VAR2  PIC X(15) VALUE SPACES.               
 05 FILE-ENVIRONMENT-VAR3  PIC X(07) VALUE ") MOD ".             
 01 DYN-STATUS        PIC 9(02).                                 
 01 RC                PIC 9(09) BINARY VALUE 0.                 
 PROCEDURE DIVISION.                                             
     ACCEPT FILE-ENVIRONMENT-VAR2 FROM SYSIN.                   
     SET ADDRESS-POINTER TO ADDRESS OF FILE-ENVIRONMENT-VAR.     
     CALL "PUTENV" USING BY VALUE ADDRESS-POINTER RETURNING
                    RC  . 
     IF RC IS EQUAL TO ZERO                                     
        DISPLAY ' GOOD '                                         
     ELSE                                                       
        DISPLAY ' BAD '                   
        STOP RUN.                         
     OPEN OUTPUT INPUT-FILE.                   
     MOVE ' FUNNY ' TO INPUT-RECORD.       
     WRITE INPUT-RECORD.                   
     CLOSE INPUT-FILE.                     
     STOP RUN.       


I have coded to accept this
Code:

//SYSIN    DD *                     
MNT7.VA.TEST.#4                     


as the Instream Data, but u may have to edit the variable if you pass other data along with the DSN and put it in the Environment Variable. Also compile the pgm with NODYNAM option.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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