/**
 * @file   SCFCUCNV.c
 * @brief  Sample program in c to run FLUC-CONV
 * @author limes datentechnik gmbh
 **********************************************************************/

/* defines code page for literals for IBM mainframes to German */
#ifdef __ZOS__
#  pragma convert(1141)
#endif

#include<stdio.h>
#include<stdlib.h>

#include"FLUCUP.h"

/**
 * This test program takes one parameter from command line to convert
 * files via the FLUC subprogram.
 *
 * @param argc must be 2
 * @param argv contains the string for flucconv
 * @return flucup error
 */
int main(int argc, char * argv[])
{
   unsigned int         i;

/* defines environment variable LANG to German EBCDIC for IBM mainframes */
#ifdef __ZOS__
   __setenv("LANG","de_DE.IBM-1141",1);
#endif

   if (argc!=2) {
      fprintf(stderr,"Parameter count (%d) not correct (2) to run this sample program\n",argc);
      fprintf(stderr,"Given parameter:\n");
      for (i=0;i<argc;i++) fprintf(stderr,"--> P%2.2u(%s)\n",i,argv[i]);
      fprintf(stderr,"Required parameter:\n");
      fprintf(stderr,"   :> %s \"conversion string\"\n",argv[0]);
      fprintf(stderr,"CONVERSION STRING: ");
      flucsyn(FLUC_CONV,1,NULL,NULL);
      fprintf(stderr,"\n");
      exit(20);
   }
   return(flucconv(argv[1],NULL,":STDERR",NULL));
}

/******************************************************************************/

