C/C++ JCL's



Help for C/C++ for MVS, OS/390 C/C++, z/OS C/C++ and C/C++ Productivity Tools for OS/390

C/C++ JCL's

Postby anandhakrishna » Fri Feb 08, 2013 3:57 pm

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.
anandhakrishna
 
Posts: 6
Joined: Thu Feb 07, 2013 12:40 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time

Re: C/C++ JCL's

Postby enrico-sorichetti » Fri Feb 08, 2013 4:03 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: C/C++ JCL's

Postby NicC » Wed Jul 10, 2013 9:01 pm

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
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: C/C++ JCL's

Postby BillyBoyo » Wed Jul 10, 2013 11:54 pm

What have you tried? Anything in the manuals? You want to use JCL alone?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to C, C++