Page 1 of 1

C/C++ JCL's

PostPosted: Fri Feb 08, 2013 3:57 pm
by anandhakrishna
Hi Guys,

I am trying to access VSAM datasets from a C/C++ progam in zOS. As regs this, I tried compiling C Pogram and it works fine. When i try to compile a fileread C progam , i am getting error. Kindly help.

Thereby i am pasting the C Progam which i used.

#include <stdio.h>

int main()
{
FILE *filepointer;
int character;
filepointer=fopen("ch.txt", "r");
if (filepointer==NULL) {
printf("Could not open data.txt!\n");
return 1;
}

while ((character=fgetc(filepointer)) != EOF)
{
printf("The output is:", character);
putchar(character);

getch();
}
fclose(filepointer);
return 0;
}

Note: This prog works fine in normal C in Windows.

Re: C/C++ JCL's

PostPosted: Fri Feb 08, 2013 4:03 pm
by enrico-sorichetti
First
DO NOT POST THE SAME QUESTION ON MULTIPLE FORUMS

it will not get You double answers

the portal page of ibmmainframes.com tells clearly that this one is a partner site
...
and the people answering here are the same answering there

second ...
You simply did not care/forgot to read the manuals about using VSAM in C
for example
http://publib.boulder.ibm.com/infocente ... vsamdd.htm
( or the equivalent for Your zOS level )

Your other topic has been locked

Re: C/C++ JCL's

PostPosted: Wed Jul 10, 2013 9:01 pm
by NicC
Hmmmmmm.....just browsing an old topic or two. This one a) does not say WHAT error, b) it is trying to read a text file (sequential) and c) with a non-mainframe name. There has been no reponse from TS. Can we delete the topic?

edited

Re: C/C++ JCL's

PostPosted: Wed Jul 10, 2013 11:54 pm
by BillyBoyo
What have you tried? Anything in the manuals? You want to use JCL alone?