473,835 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C programming on Mainframe z/OS batch

5 New Member
Hello,

I have a mainframe C program which I am attempting to pass a 16 character number such as 698... I defined mainf(int argc, char *argv[]). In my batch execution JCL I use a dd card of //SYSIN DD * then the 16 digit number.

Upon entering the program I have placed printf's to display what I am getting.

Here is what I receive for argc a 1 for argrv[0] SHA256 or the name of the program then argv[1] and it is nothing. Does anyone have any suggestions fetting to the number here? Obviously the number is not getting into the program.

Also I noticed that when I compile I have a compile option of NOCICS and I cannot find this compile parameter described.

Expand|Select|Wrap|Line Numbers
  1. void main (int argc, char*argv[]);
  2. printf("%x\n",argc);       
  3. printf("%s\n",argv[0]);    
  4. printf("%s\n",argv[1]);    
Thank you,

mpark090
Feb 20 '07 #1
7 6871
sicarie
4,677 Recognized Expert Moderator Specialist
Hello,

I have a mainframe C program which I am attempting to pass a 16 character number such as 698... I defined mainf(int argc, char *argv[]). In my batch execution JCL I use a dd card of //SYSIN DD * then the 16 digit number.

Upon entering the program I have placed printf's to display what I am getting.

Here is what I receive for argc a 1 for argrv[0] SHA256 or the name of the program then argv[1] and it is nothing. Does anyone have any suggestions fetting to the number here? Obviously the number is not getting into the program.

Also I noticed that when I compile I have a compile option of NOCICS and I cannot find this compile parameter described.

Code

void main (int argc, char*argv[]);
printf("%x\n",a rgc);
printf("%s\n",a rgv[0]);
printf("%s\n",a rgv[1]);

Thank you,

mpark090
Have you tried using printf with '%c' instead of '%s'?

And what do you mean by a '16 character number'? "fifteen hundred?" or 123456789012345 6?
Feb 20 '07 #2
AdrianH
1,251 Recognized Expert Top Contributor
Hello,

I have a mainframe C program which I am attempting to pass a 16 character number such as 698... I defined mainf(int argc, char *argv[]). In my batch execution JCL I use a dd card of //SYSIN DD * then the 16 digit number.

Upon entering the program I have placed printf's to display what I am getting.
Hi mpark,

I'm not familiar with a JCL or DD cards, so I looked it up from google and found it on wikipedia here. From what it states, it looks like you can not pass a parameter to a DD card, but I only have the wiki for background so maybe I'm wrong. However, it does look like you can pass parameters using EXEC PGM or EXEC PROC.

Is this what you are looking for?


Adrian
Feb 20 '07 #3
mpark090
5 New Member
Hi mpark,

I'm not familiar with a JCL or DD cards, so I looked it up from google and found it on wikipedia here. From what it states, it looks like you can not pass a parameter to a DD card, but I only have the wiki for background so maybe I'm wrong. However, it does look like you can pass parameters using EXEC PGM or EXEC PROC.

Is this what you are looking for?


Adrian
Adrian,

Thank you so much. I did get the program to accept the value by passing it on the PARM of the EXEC card like such EXEC PGM=pgmanme,PAR M='\22334444444 4444'. Just in case you want to run a C program in batch with main(agrc,argv) .

Regards,

mpark090
Feb 21 '07 #4
mpark090
5 New Member
Have you tried using printf with '%c' instead of '%s'?

And what do you mean by a '16 character number'? "fifteen hundred?" or 123456789012345 6?

Thank you. I never though about the '%c' so I'll give that a try.

As for the 16 character number, I have spent too many years with COBOL. I did, however, get the program to accept the input by using a PARM on the EXEC card. By saying PARM='\12345678 90123456' the program gave me the number back in the SYSPRINT.

Regards,

mpark090
Feb 21 '07 #5
AdrianH
1,251 Recognized Expert Top Contributor
Adrian,

Thank you so much. I did get the program to accept the value by passing it on the PARM of the EXEC card like such EXEC PGM=pgmanme,PAR M='\22334444444 4444'. Just in case you want to run a C program in batch with main(agrc,argv) .

Regards,

mpark090
Glad to help, keep on coding :)


Adrian
Feb 21 '07 #6
RedSon
5,000 Recognized Expert Expert
Wow, how old is that system you are working on?
Feb 21 '07 #7
mpark090
5 New Member
Wow, how old is that system you are working on?
I think the operating system may be z/OS 1.7 as for the C compiler I haven't really detemined it's age. The COBOL compiler may be current.

How about we say ancient or maybe prehistoric? (making fun here). I've been in the business since 1973.

mpark090
Feb 28 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
18884
by: Erik-Jan Bakker | last post by:
Hi I am not a javascript expert and I have a problem that the guru's in this newsgroup probably can solve quickly. ;-) I've made a webpage with three frames: top, left and mainframe. I defined this in a frameset called index.htm. Each frame is loaded with a specific page: top:title.htm, left:menu.htm and mainframe:start.htm. So far so good...
26
2266
by: Kanthi Kiran Narisetti | last post by:
Hi ALL, I am new to C and programming . I need suggestions for the IDE to be used as a begginer and should I start on Windows or Linux ?? I am also looking for resources for C programming on Internet with examples on each concept. I appreciate if any one can help me in this regard.
4
5351
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am trying to decide if I should use remoting vs. writing a server that uses networkstreams. I have read that networkstreams\tcp programming should be faster than remoting and is a better choice for what I am doing but that it is difficult to code.
1
2259
by: uli2003wien | last post by:
Dear group, i am a seasoned DB2-veteran (6 years exp.) on the Windows- and Linux-Server platform. Once in a while i had a look into DB2 on the mainframe but mostly only watching other people do the job. Currently i have an offer to go into a very big shop which runs DB2 on the mainframe (OS is not yet specified, but they talk about VSAM, so it will be no UNIX on mainframe). From my knowledge DB2 on Linux or Windows is a different...
1
1649
by: Gil Lapid | last post by:
Hi, What is the recommended way to develop DB2 Mainframe application without buying this expensive hardware/software ? I'd like to develop the software for a Mainframe customer. Thanks, Gil
0
1630
by: rAinDeEr | last post by:
Hi.. 1. ) We have a Test Database in a mainframe system and are migrating the Data to a UDB machine in Linux environment. What are the different aspects to be considered. ? 2.) Can some one point me to any relevant document like the system configuration needed, taking care of referential integrity etc...for data migration from Z/OS to UDB v 8.2 ?
17
1865
by: sloan | last post by:
I found these (2 links below). Does anyone know of any (neutral) reference sites for this kind of information? http://www.itjungle.com/tug/tug121406-story03.html Microsoft's Visual Basic 6 and Visual Basic.NET language is taking a serious beating in the development cubicles of the United States and Canada. http://www.eweek.com/article2/0,1895,2065392,00.asp Study: Developer Use of Visual Basic Plummets
0
2074
by: cngtx | last post by:
Hi, I could not figure out why I am getting the following error when I initiated the Insert into the mainframe DB2 table from a server. I have created the trigger and the stored procedure (as shown below). If I insert a row into the table using batch sql job on mainframe, the stored procedure is triggered by the db2 trigger successfully after a row is inserted into the table. However, if I do the same insert through front-end apps using a...
151
8146
by: istillshine | last post by:
There are many languages around: C++, JAVA, PASCAL, and so on. I tried to learn C++ and JAVA, but ended up criticizing them. Is it because C was my first programming language? I like C because, comparatively, it is small, efficient, and able to handle large and complex tasks. I could not understand why people are using and talking about other programming languages.
0
9802
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10559
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10230
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9343
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7765
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6961
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5632
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5802
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.