Transcodage des données de mainframe transférées vers Google Cloud à l'aide d'une bibliothèque de bandes virtuelle
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
La transcodification de données localement sur un mainframe est un processus gourmand en processeur qui entraîne une consommation élevée de millions d'instructions par seconde (MIPS). Pour éviter cela, vous pouvez utiliser Cloud Run pour déplacer et transcoder des données de mainframe à distance surGoogle Cloud. Cela libère votre mainframe pour les tâches critiques pour l'entreprise et réduit également la consommation de MIPS.
Si vous souhaitez déplacer de très grands volumes de données (environ 500 Go par jour ou plus) de votre mainframe vers Google Cloud, et que vous ne souhaitez pas utiliser votre mainframe pour cette tâche, vous pouvez utiliser une solution de bibliothèque de bandes virtuelles (VTL) compatible avec le cloud pour transférer les données vers un bucket Cloud Storage. Vous pouvez ensuite utiliser Cloud Run pour transcoder les données présentes dans le bucket et les déplacer vers BigQuery.
Cette page explique comment lire les données de mainframe copiées dans un bucket Cloud Storage, les transcoder du format EBCDIC (Extended Binary Coded Decimal Interchange Code) au format ORC en UTF-8, puis les charger dans une table BigQuery.
Le diagramme suivant montre comment déplacer vos données de mainframe vers un bucket Cloud Storage à l'aide d'une solution VTL, transcoder les données au format ORC à l'aide de Cloud Run, puis déplacer le contenu vers BigQuery.
Transcodage à distance des données de mainframe à l'aide de VTL
Avant de commencer
Choisissez une solution VTL adaptée à vos besoins, puis déplacez vos données de mainframe vers un bucket Cloud Storage et enregistrez-les en tant que .dat. Assurez-vous d'ajouter une clé de métadonnées nommée x-goog-meta-lrecl au fichier .dat importé et que la longueur de la clé de métadonnées est égale à la longueur d'enregistrement du fichier d'origine, par exemple 80.
Dans votre mainframe, définissez la variable d'environnement GCSDSNURI sur le préfixe que vous avez utilisé pour vos données mainframe sur le bucket Cloud Storage.
export GCSDSNURI="gs://BUCKET/PREFIX"
Remplacez les éléments suivants :
BUCKET: nom du bucket Cloud Storage.
PREFIX: préfixe que vous souhaitez utiliser dans le bucket.
Créez un compte de service ou identifiez un compte de service existant à utiliser avec Mainframe Connector. Ce compte de service doit disposer d'autorisations pour accéder aux buckets Cloud Storage, aux ensembles de données BigQuery et à toute autre ressource que vous souhaitez utiliser. Google Cloud
Transcoder des données de mainframe importées dans un bucket Cloud Storage
Pour déplacer des données de mainframe vers Google Cloud à l'aide de VTL et effectuer une transcodage à distance, vous devez effectuer les tâches suivantes:
Lire et transcoder les données présentes dans un bucket Cloud Storage au format ORC L'opération de transcodage convertit un jeu de données EBCDIC de mainframe au format ORC en UTF-8.
Chargez l'ensemble de données dans une table BigQuery.
(Facultatif) Exécutez une requête SQL sur la table BigQuery.
(Facultatif) Exporter des données de BigQuery vers un fichier binaire dans Cloud Storage.
Pour effectuer ces tâches, procédez comme suit:
Dans votre mainframe, créez une tâche pour lire les données d'un fichier .dat dans un bucket Cloud Storage et les transcoder au format ORC, comme suit.
Pour obtenir la liste complète des variables d'environnement compatibles avec le connecteur Mainframe, consultez la section Variables d'environnement.
(Facultatif) Créez et envoyez une tâche de requête BigQuery qui exécute une lecture SQL à partir du fichier DD QUERY.
En règle générale, la requête est une instruction MERGE ou SELECT INTO DML qui entraîne la transformation d'une table BigQuery. Notez que le connecteur Mainframe consigne les métriques de tâche, mais n'écrit pas les résultats de la requête dans un fichier.
Vous pouvez interroger BigQuery de différentes manières : en ligne, avec un ensemble de données distinct à l'aide de DD ou avec un ensemble de données distinct à l'aide de DSN.
PROJECT_NAME: nom du projet dans lequel vous souhaitez exécuter la requête.
LOCATION: emplacement où la requête sera exécutée. Nous vous recommandons d'exécuter la requête dans un emplacement proche des données.
(Facultatif) Créez et envoyez un job d'exportation qui exécute une lecture SQL à partir du fichier DD QUERY et exporte le jeu de données obtenu vers Cloud Storage en tant que fichier binaire.
PROJECT_NAME: nom du projet dans lequel vous souhaitez exécuter la requête.
DATASET_ID: ID de l'ensemble de données BigQuery contenant la table que vous souhaitez exporter.
DESTINATION_TABLE: table BigQuery que vous souhaitez exporter.
BUCKET: bucket Cloud Storage qui contiendra le fichier binaire de sortie.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/03 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/03 (UTC)."],[],[],null,["# Transcode mainframe data moved to Google Cloud using virtual tape library\n\nTranscoding data locally on a mainframe is a CPU-intensive process that results\nin high million instructions per second (MIPS) consumption. To avoid this, you\ncan use Cloud Run to move and transcode mainframe data remotely on\nGoogle Cloud. This frees up your mainframe for business critical tasks and also\nreduces MIPS consumption.\n\nIf you want to move very large volumes of data (around 500 GB per day or more)\nfrom your mainframe to Google Cloud, and don't want to use your mainframe for\nthis effort, you can use a cloud-enabled [Virtual Tape Library (VTL)](https://en.wikipedia.org/wiki/Virtual_tape_library) solution to transfer the data to a Cloud Storage\nbucket. You can then use Cloud Run to transcode data present in the\nbucket and move it to BigQuery.\n\nThis page discusses how to read mainframe data copied into a Cloud Storage\nbucket, transcode it from the extended binary coded decimal interchange code\n(EBCDIC) dataset to the ORC format in UTF-8, and load the dataset to a\nBigQuery table.\n| **Note:** This page doesn't explain you how to copy your data from your mainframe to a Cloud Storage bucket. The procedure described in this page starts with the assumption that you've moved your mainframe data to a Cloud Storage bucket.\n\nThe following diagram shows how you can move your mainframe data to a\nCloud Storage bucket using a VTL solution, transcode the data to the ORC\nformat using Cloud Run, and then move the content to BigQuery.\n\n\u003cbr /\u003e\n\nRemotely transcode mainframe data using VTL\n\n\u003cbr /\u003e\n\nBefore you begin\n----------------\n\n- Choose a VTL solution that suits your requirements and move your mainframe data to a Cloud Storage bucket and save it as a `.dat`. Ensure that you add a [metadata key](/storage/docs/viewing-editing-metadata#command-line_1) named `x-goog-meta-lrecl` to the uploaded `.dat` file, and that the metadata key length is equal to the original file's record length, for example 80.\n- [Deploy Mainframe Connector on Cloud Run](/mainframe-connector/docs/deploy-mainframe-connector).\n- In your mainframe, set the `GCSDSNURI` environment variable to the prefix that you have used for your mainframe data on Cloud Storage bucket. \n\n ```\n export GCSDSNURI=\"gs://BUCKET/PREFIX\"\n ```\n Replace the following:\n - \u003cvar translate=\"no\"\u003eBUCKET\u003c/var\u003e: The name of the Cloud Storage bucket.\n - \u003cvar translate=\"no\"\u003ePREFIX\u003c/var\u003e: The prefix that you want to use in the bucket.\n- [Create a service account](/iam/docs/service-accounts-create) or identify an existing service account to use with Mainframe Connector. This service account must have permissions to access Cloud Storage buckets, BigQuery datasets, and any other Google Cloud resource that you want to use.\n- Ensure that the service account you created is assigned the [Cloud Run Invoker role](/run/docs/reference/iam/roles#run.invoker).\n\nTranscode mainframe data uploaded to a Cloud Storage bucket\n-----------------------------------------------------------\n\nTo move mainframe data to Google Cloud using VTL and transcode remotely,\nyou must perform the following tasks:\n\n1. Read and transcode the data present in a Cloud Storage bucket to the ORC format. The transcoding operation converts a mainframe EBCDIC dataset to the ORC format in UTF-8.\n2. Load the dataset to a BigQuery table.\n3. (Optional) Execute a SQL query on the BigQuery table.\n4. (Optional) Export data from BigQuery into a binary file in Cloud Storage.\n\nTo perform these tasks, follow these steps:\n\n1. In your mainframe, create a job to read the data from a `.dat`\n file in a Cloud Storage bucket, and transcode it to ORC format, as follows.\n\n | **Note**\n | - Not all Google Cloud commands support remote transcoding. For more information, see [Mainframe Connector API reference](/mainframe-connector/docs/reference).\n | - Variables with the suffix FILLER are ignored during the import process.\n | - From version 5.12.0 onwards, Mainframe Connector replaces hyphens (\"-\") with underscores (\"_\") in variable names. If you want to keep hyphens in your variable names, disable this automatic conversion by setting the database variable `BQSH_FEATURE_CONVERT_UNDERSCORE_IN_FIELDS_NAME` to `false`.\n\n For the complete list of environment variables supported by\n Mainframe Connector, see [Environment variables](/mainframe-connector/docs/environment-variables). \n\n //STEP01 EXEC BQSH\n //COPYBOOK DD DISP=SHR,DSN=\u003cHLQ\u003e.COPYBOOK.FILENAME\n //STDIN DD *\n gsutil cp --replace gs://mybucket/tablename.orc \\\n --inDsn \u003cvar translate=\"no\"\u003eINPUT_FILENAME\u003c/var\u003e \\\n --remoteHost \u003cmainframe-connector-url\u003e.a.run.app \\\n --remotePort 443 \\\n --project_id \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n /*\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: The name of the project in which you want to execute the query.\n - \u003cvar translate=\"no\"\u003eINPUT_FILENAME\u003c/var\u003e: The name of the `.dat` file that you uploaded to a Cloud Storage bucket.\n\n If you want to log the commands executed during this process, you can [enable load statistics](/mainframe-connector/docs/reference#enable_load_statistics).\n2. (Optional) Create and submit a BigQuery query job that executes a SQL read from\n the [QUERY DD file](/mainframe-connector/docs/reference#dataset-names).\n Typically the query will be a `MERGE` or `SELECT INTO DML`\n statement that results in transformation of a BigQuery table. Note\n that Mainframe Connector logs in job metrics but doesn't write query\n results to a file.\n\n You can query BigQuery in various ways-inline, with a separate\n dataset using DD, or with a separate dataset using DSN. \n\n Example JCL\n //STEP03 EXEC BQSH\n //QUERY DD DSN=\u003cHLQ\u003e.QUERY.FILENAME,DISP=SHR\n //STDIN DD *\n PROJECT=\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n LOCATION=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n bq query --project_id=$PROJECT \\\n --location=$LOCATION/*\n /*\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: The name of the project in which you want to execute the query.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The location for where the query will be executed. We recommended that you execute the query in a location close to the data.\n3. (Optional) Create and submit an export job that executes a SQL read from the\n [QUERY DD file](/mainframe-connector/docs/reference#dataset-names), and exports\n the resulting dataset to Cloud Storage as a binary file.\n\n Example JCL\n //STEP04 EXEC BQSH\n //OUTFILE DD DSN=\u003cHLQ\u003e.DATA.FILENAME,DISP=SHR\n //COPYBOOK DD DISP=SHR,DSN=\u003cHLQ\u003e.COPYBOOK.FILENAME\n //QUERY DD DSN=\u003cHLQ\u003e.QUERY.FILENAME,DISP=SHR\n //STDIN DD *\n PROJECT=\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n DATASET_ID=\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e\n DESTINATION_TABLE=\u003cvar translate=\"no\"\u003eDESTINATION_TABLE\u003c/var\u003e\n BUCKET=\u003cvar translate=\"no\"\u003eBUCKET\u003c/var\u003e\n bq export --project_id=$PROJECT \\\n --dataset_id=$DATASET_ID \\\n --destination_table=$DESTINATION_TABLE \\\n --location=\"US\" \\\n --bucket=$BUCKET \\\n --remoteHost \u003cmainframe-connector-url\u003e.a.run.app \\\n --remotePort 443\n /*\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: The name of the project in which you want to execute the query.\n - \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: The BigQuery dataset ID that contains the table that you want to export.\n - \u003cvar translate=\"no\"\u003eDESTINATION_TABLE\u003c/var\u003e: The BigQuery table that you want to export.\n - \u003cvar translate=\"no\"\u003eBUCKET\u003c/var\u003e: The Cloud Storage bucket that will contain the output binary file."]]