Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us