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 IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts VSAM File free space sancraig16 JCL & VSAM 13 Fri Mar 30, 2018 1:02 am
No new posts write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am

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