COBOL SELECT CLUASE



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: COBOL SELECT CLUASE

Postby BillyBoyo » Thu Feb 28, 2013 1:18 pm

It is not a RETURN-CODE, it is a FILE-STATUS. Find out what a FILE-STATUS of 05 means.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Re: COBOL SELECT CLUASE

 

Re: COBOL SELECT CLUASE

Postby pmartyn » Thu Feb 28, 2013 11:21 pm

There is also the ability for COBOL to dynamically open the new file. No SELECT clause or JCL required.
Here is the source code;
MOVE 'YOUR.FILE.NAME' TO FN.
STRING 'ALLOC DD(OTFILE) DSN(' FN ') NEW '
'CATALOG ' 'LRECL(80) RECFM(F,B)' <<=== REMEMBER TO CHANGE THIS TO YOUR PARAMETERS
DELIMITED BY SIZE
INTO WS-ALLOC-STRING
END-STRING.
DISPLAY ' WS-ALLOC-STRING *' WS-ALLOC-STRING '*'
CALL 'BPXWDYN' USING WS-ALLOC-STRING.
DISPLAY RETURN-CODE.
OPEN OUTPUT OT-FILE. Then write to it and when you are done close it.
pmartyn
 
Posts: 42
Joined: Thu Feb 28, 2013 7:11 pm
Has thanked: 5 times
Been thanked: 3 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post