Menu
  • HOME
  • TAGS

I have a variable with PIC S9(4). Whether I use COMP or COMP-3 here?

cobol,mainframe

Much of that is platform dependent. As a general rule, "comp", which is a twos compliment binary is going to be a little faster, and "comp-3" which is packed decimal, is going to be human readable as decimal in memory or on DASD, is easier for humans to work with....

Create a table in Cobol from a copybook?

cobol,mainframe

The IBM's mainframe supports nested copybooks, so you can change your copybook to a nested copybook Also have a look at "COPY" statement with "REPLACING" in COBOL so 01 record-layout-1. ... 01 record-layout-2. ... 01 record-layout-3. ... can be changed to 01 record-layout-1. ... 01 record-layout-2. ... 01 record-layout-3. copy...

Loop until data set is not in use with JCL

mainframe,zos,jcl

The easy way to do this is to ensure that your file transfer package allocates the dataset with an OLD disposition, that will create a system level enqueue on the dataset and prevent your job from running until the enqueue is released. Many file transfer packages offer some sort of...

Bit shifting in IBM assembler

assembly,bit-manipulation,mainframe

ICM R7,B'1111',FIRSTBUF LOAD 4 BYTES FROM FIRSTBUF INTO REGISTER 7 SLL R7,2 ; Shift away zeros LR R8,R7 ; Move to a work register AND R8, 0x3F ; Clear out extra bits. ; First Character complete. SLL R7,8 ; Remove 1 character and lower 2 bit 0s by shifting...

Use C# to FTP file to mainframe including dataset - Translate FTP script to FtpWebRequest code

c#,.net,ftp,mainframe,ftpwebrequest

You didn't specify what platform you run the ftp script at. I assume Windows. When you use Windows ftp command put like: put localpath remotepath it results in following call on the FTP server: STOR remotefile Similarly if you use FtpWebRequest with an URL like ftp://example.com/remotepath is results in following...

date-dependent automated tests in mainframe context

unit-testing,cobol,mainframe

This is a trick thing with any automated unit testing -- even Junit testing. The answer is you must pass in the dates. Set up wrappers to "read current date and add it to the parameter list" for production, but have your unit tests call the modules that receive the...

Find matched and unmatched records and position of key-word is unknown [closed]

sorting,cobol,mainframe

An example, pseudo-codeish, Cobol: Open File1 Read File1 into The-Record Perform until End-Of-File Perform varying II from 1 by 1 until II > length of The-Record If The-Record (II:5) = 'COBOL' Display "Found COBOL at position " II End-If End-Perform Read File1 into The-Record End-perform Repeat for file2 with the...

FTP file to Mainframe

java,ftp,mainframe

I am assuming that you want to run your JCL text file when FTP'ed. Enclose try {} and catch {} block (if not done). Here's the code (This works for me): // FTPClient ftp = new FTPClient(); Assumed in your code //Connect to the server try { ftp.connect(host); replyText =...

Data validation for file and formatting the output

cobol,mainframe

In your latest version, you have made a group item (DATE-DUE) but you have not adjusted the level-numbers for the other date fields which are subordinate to it. I have made those three level 10. To use SYSIN data to be convenient for me, I added a 32-byte FILLER to...

What is the difference between a variable-blocked format and a fixed-blocked format?

cobol,mainframe,jcl

Forget what you know about data on a harddisk under Windows or Unix/Linux. Fixed-length records (which can be Record Format (RECFM) F for unblocked, FB for blocked (they can also be FBS, which is Fixed Block Standard, but for a simple single-use dataset (file) it is equivalent to an FB)...

REXX/SORT split sequential file

mainframe,rexx,syncsort

For a fixed-position start of the trigger: OPTION COPY INREC IFTHEN=(WHEN=GROUP, BEGIN=(1,5,CH,EQ,C'start'), PUSH=(171:ID=1)) OUTFIL OMIT=(171,1,CH,EQ,C' '), BUILD=(1,170) For a variable-position, unique, trigger: OPTION COPY INREC IFTHEN=(WHEN=GROUP, BEGIN=(1,170,SS,EQ,C'start'), PUSH=(171:ID=1)) OUTFIL OMIT=(171,1,CH,EQ,C' '), BUILD=(1,170) WHEN=GROUP gives you PUSH, which will put data from the current record, or a group-number (ID) or number...

Formatting breaklines with ICETOOL's DISPLAY

mainframe,dfsort

DFSORT's ICETOOL DISPLAY operator has many options, which means there is extensive documentation for it. You should consult the DFSORT Getting Started manual for introductory-level use, and DFSORT Application Programming Guide for more high-level use. Within BCOUNT, all numeric fields will appear with totals. Your account is numeric (binary), but...

Connecting to TN3270 Mainframe using VBA

excel-vba,mainframe

As Bruce Martin stated, it depends on the Emulator which we are using. I am using the EXTRA! Attachmate which can be automated using Excel VBA using the Extra keyword in the createobject object. Something like: set New=createObject(Extra.system) After connection you can use the sendkeys, getstring, putstring keywords along with...

Errors in if Statement

cobol,mainframe

piet.t and Bruce Martin have correctly spotted the errors which are giving you those compiler diagnostics. You did not help by listing the wrong line as number 165. An easy thing to do to avoid this problem is to get the compiler to embed the diagnostics, as well as listing...

Getting output queue via FTP of a Mainframe (zOS)

java,ftp,mainframe,zos

It looks like the output you show from the example link in your question uses JESINTERFACELEVEL=2. The output you are getting yourself is from using JESINTERFACELEVEL=1. With JESINTERFACELEVEL=1 attempting to list specific details by jobid (TSU-prefix is for a Time Sharing User, so is a TSO session (from where you...

SELECT operator

mainframe,dfsort

I'm a big fan of SORT symbols/SYMNAMES, so nice to see you using that, and in a fairly advanced way. You only specify one start position for your record, and relate everything else to the previous field, which is the most flexible way to do it. I didn't realise a...

Why FtpWebRequest is adding the user login as part of the target dataset?

c#,ftp,ibm,mainframe,ftpwebrequest

Your code is correct and should work. When I use your code, my log shows: FtpWebRequest#7746814::.ctor(ftp://abc.wyx.state.aa.bb/'ABCD.AA.C58FC.ABC1FD.ZP3ABC') Note the quotes. But they are missing in your log: FtpWebRequest#53578024::.ctor(ftp://abc.wyx.state.aa.bb/ABCD.AA.C58FC.ABC1FD.ZP3ABC) Are you really showing us your exact code and matching log file? The WebRequest.Create creates an Uri class our of the URI string...

GROUP BY CLAUSE using SYNCSORT

group-by,mainframe,syncsort

You show data already in sequence, so there is no need to sort the data itself, which makes SUM FIELDS= with SORT a poor solution if anyone suggests it (plus code for the formatting). MERGE with a single input file and SUM FIELDS= would be better, but still require the...

Tracking errors from z/os's syslog

syslog,mainframe,zos

It depends: If there are TWS-specific errors you have to track them using the EQQ messages. Otherwise I'd go for the scheduler-independent and probably more detailed MVS messages. And most of these messages haven't changed much in decades....

Behavior of STRING verb

cobol,mainframe

Here's the syntax-diagram for STRING (from the Enterprise COBOL Language Reference): Now you need to know how to read it. Fortunately, the same document tells you how: How to read the syntax diagrams Use the following description to read the syntax diagrams in this document: . Read the syntax diagrams...

Not a uniquely defined Name?

cobol,mainframe

Thje variable LOWMID-COMMISSION-CTR is defined twice. once in FLAGS-AND-ACCUMLATORS 01 FLAGS-AND-ACCUMLATORS. 05 LOW-COMMISSION-CTR PIC 99999 VALUE ZERO. 05 LOWMID-COMMISSION-CTR PIC 99999 VALUE ZERO. once in HEADING-LINE-4 01 HEADING-LINE-4. 05 PIC X(03) VALUE SPACES. 05 PIC X(52) VALUE "Number of employees from 10,001 to 20,000 in sales: ". 05 LOWMID-COMMISSION-CTR PIC...

Is there a C debugger for zOS? [closed]

c,debugging,gdb,mainframe,zos

Yes, IBM has a Debug Tool for z/OS which allows debugging at a higher level than assembler language. I think it's separate from the xlc stuff so you'll have to pay for it but, since you're running a mainframe, that probably won't be an issue :-)...

In COBOL, is it possible to recursively call a paragraph?

recursion,ibm,cobol,mainframe

Check the current COBOL Language Reference, but AFAIR a para cannot PERFORM itself. The wording is something like you will get unpredictable results, as recursion is not supported. If you need to wind over the same code perhaps refactoring to use PERFORM UNTIL is what you need?...

Swap Date around on a Natural Programming language variable?

mainframe

The easiest way to do this is two redefine your variable and them just move and use the pieces of the redefine. DEFINE #DOB(A10) REDEFINE #DOB(#Y(A4) #M(A2) #D(A2)) Then you can just use the piece and move them around the way that you want. WRITE WORK FILE 2 #M ','...

Mainframe - SAS

sas,mainframe,sas-ods

The titles are repeated once per page normally; a page is controlled by options ps=. options ps=100; would give you 100 line pages, for example....

How can I convince z/OS scp to transfer binary files?

linux,file-transfer,scp,mainframe,zos

You can use one of the other SSH-based tools such as sftp. Whereas scp will let you transfer a file (with automatic authentication set up) with something like: scp -i ident_file zos_file [email protected]_box:linux_file you can do a similar thing with the secure FTP: sftp IdentityFile=ident_file -b - [email protected]_box <<EOF binary...

Explain the use of full-stop/period/point in a paragraph

cobol,mainframe

You are correct, the code you show is equivalent. A paragraph or a SECTION must end with a full-stop/period/point. This means that the last thing (other than a comment or a blank line) in a paragraph or a SECTION must be a full-stop/period/point. This does not mean that a full-stop/period/point...

Comparing what's in a variable to text?

cobol,mainframe

You are using NOO as if it was a CLASS. I will skip what a CLASS is here (but NUMERIC is a CLASS that regroup numeric values "0, 1, 2, 3, 4, 5, 6, 7, 8, 9" for example). I will just explain how to compile your code and make...

Excel spreadsheet to COBOL program

excel-vba,cobol,mainframe,jcl

You might want to split your task in several steps Extract data from Excel sheet Make data available to COBOL program Work with data in COBOL Not knowing the details of your problem I can only suggest solutions at this point: Use Visual Basic for applications to create a file...